Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trac 58833 - Docs: improve comments, to align with Coding Standards. #5507

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/wp-admin/includes/class-wp-comments-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ public function single_row( $item ) {
current_user_can( 'read_post', $comment->comment_post_ID )
)
) {
// The user has access to the post
// The user has access to the post.
} else {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/class-wp-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ protected function comments_bubble( $post_id, $pending_comments ) {
current_user_can( 'read_post', $post_id )
)
) {
// The user has access to the post and thus can see comments
// The user has access to the post and thus can see comments.
} else {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ function wp_is_authorize_application_redirect_url_valid( $url ) {
$host = wp_parse_url( $url, PHP_URL_HOST );
$is_local = 'local' === wp_get_environment_type();

// validates if the proper URI format is applied to the $url
// Validates if the proper URI format is applied to the $url.
if ( empty( $host ) || empty( $scheme ) || in_array( strtolower( $scheme ), $invalid_protocols, true ) ) {
return new WP_Error(
'invalid_redirect_url_format',
Expand Down
4 changes: 2 additions & 2 deletions src/wp-includes/media.php
Original file line number Diff line number Diff line change
Expand Up @@ -2636,7 +2636,7 @@ function gallery_shortcode( $attr ) {
if ( ! empty( $post_parent_id ) ) {
$post_parent = get_post( $post_parent_id );

// terminate the shortcode execution if user cannot read the post or password-protected
// Terminate the shortcode execution if user cannot read the post or password-protected.
if (
( ! is_post_publicly_viewable( $post_parent->ID ) && ! current_user_can( 'read_post', $post_parent->ID ) )
|| post_password_required( $post_parent ) ) {
Expand Down Expand Up @@ -2979,7 +2979,7 @@ function wp_playlist_shortcode( $attr ) {
if ( ! empty( $args['post_parent'] ) ) {
$post_parent = get_post( $id );

// terminate the shortcode execution if user cannot read the post or password-protected
// Terminate the shortcode execution if user cannot read the post or password-protected.
if ( ! current_user_can( 'read_post', $post_parent->ID ) || post_password_required( $post_parent ) ) {
return '';
}
Expand Down
8 changes: 5 additions & 3 deletions src/wp-includes/rest-api/class-wp-rest-server.php
Original file line number Diff line number Diff line change
Expand Up @@ -486,14 +486,16 @@ public function serve_request( $path = null ) {
* Filters whether to send nocache headers on a REST API request.
*
* @since 4.4.0
* @since 6.3.2 Moved the block to catch the filter added on rest_cookie_check_errors() from rest-api.php
* @since 6.3.2 Moved the block to catch the filter added on rest_cookie_check_errors() from rest-api.php.
*
* @param bool $rest_send_nocache_headers Whether to send no-cache headers.
*/
$send_no_cache_headers = apply_filters( 'rest_send_nocache_headers', is_user_logged_in() );

// send no cache headers if the $send_no_cache_headers is true
// OR if the HTTP_X_HTTP_METHOD_OVERRIDE is used but resulted a 4x response code.
/*
* Send no cache headers if the $send_no_cache_headers is true
* OR if the HTTP_X_HTTP_METHOD_OVERRIDE is used but resulted a 4x response code.
kebbet marked this conversation as resolved.
Show resolved Hide resolved
*/
if ( $send_no_cache_headers || ( true === $method_overridden && strpos( $code, '4' ) === 0 ) ) {
foreach ( wp_get_nocache_headers() as $header => $header_value ) {
if ( empty( $header_value ) ) {
Expand Down
Loading