diff --git a/wp-activate.php b/wp-activate.php index 0349f3fa37..5949372fe7 100644 --- a/wp-activate.php +++ b/wp-activate.php @@ -68,7 +68,7 @@ if ( is_object( $wp_object_cache ) ) { $wp_object_cache->cache_enabled = false; } -// Fix for page title +// Fix for page title. $wp_query->is_404 = false; /** diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php index deea44152c..57d33f4f54 100644 --- a/wp-admin/admin-ajax.php +++ b/wp-admin/admin-ajax.php @@ -27,7 +27,7 @@ send_origin_headers(); header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) ); header( 'X-Robots-Tag: noindex' ); -// Require an action parameter +// Require an action parameter. if ( empty( $_REQUEST['action'] ) ) { wp_die( '0', 400 ); } @@ -141,7 +141,7 @@ $core_actions_post = array( 'health-check-get-sizes', ); -// Deprecated +// Deprecated. $core_actions_post_deprecated = array( 'wp-fullscreen-save-post', 'press-this-save-post', 'press-this-add-category' ); $core_actions_post = array_merge( $core_actions_post, $core_actions_post_deprecated ); @@ -189,5 +189,5 @@ if ( is_user_logged_in() ) { */ do_action( "wp_ajax_nopriv_{$action}" ); } -// Default status +// Default status. wp_die( '0' ); diff --git a/wp-admin/admin-footer.php b/wp-admin/admin-footer.php index 4c4c40a081..099b45dfe0 100644 --- a/wp-admin/admin-footer.php +++ b/wp-admin/admin-footer.php @@ -6,7 +6,7 @@ * @subpackage Administration */ -// don't load directly +// Don't load directly. if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); } @@ -104,7 +104,7 @@ do_action( 'admin_print_footer_scripts' ); */ do_action( "admin_footer-{$hook_suffix}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores -// get_site_option() won't exist when auto upgrading from <= 2.7 +// get_site_option() won't exist when auto upgrading from <= 2.7. if ( function_exists( 'get_site_option' ) ) { if ( false === get_site_option( 'can_compress_scripts' ) ) { compression_test(); diff --git a/wp-admin/admin.php b/wp-admin/admin.php index 5f8916ed41..14014b04f3 100644 --- a/wp-admin/admin.php +++ b/wp-admin/admin.php @@ -93,12 +93,12 @@ require_once( ABSPATH . 'wp-admin/includes/admin.php' ); auth_redirect(); -// Schedule trash collection +// Schedule trash collection. if ( ! wp_next_scheduled( 'wp_scheduled_delete' ) && ! wp_installing() ) { wp_schedule_event( time(), 'daily', 'wp_scheduled_delete' ); } -// Schedule Transient cleanup. +// Schedule transient cleanup. if ( ! wp_next_scheduled( 'delete_expired_transients' ) && ! wp_installing() ) { wp_schedule_event( time(), 'daily', 'delete_expired_transients' ); } @@ -182,7 +182,7 @@ if ( isset( $plugin_page ) ) { // Back-compat for plugins using add_management_page(). if ( empty( $page_hook ) && 'edit.php' == $pagenow && '' != get_plugin_page_hook( $plugin_page, 'tools.php' ) ) { - // There could be plugin specific params on the URL, so we need the whole query string + // There could be plugin specific params on the URL, so we need the whole query string. if ( ! empty( $_SERVER['QUERY_STRING'] ) ) { $query_string = $_SERVER['QUERY_STRING']; } else { @@ -347,7 +347,7 @@ if ( isset( $plugin_page ) ) { include( ABSPATH . 'wp-admin/admin-footer.php' ); - // Make sure rules are flushed + // Make sure rules are flushed. flush_rewrite_rules( false ); exit(); diff --git a/wp-admin/async-upload.php b/wp-admin/async-upload.php index 4d37f7f644..349335ec0a 100644 --- a/wp-admin/async-upload.php +++ b/wp-admin/async-upload.php @@ -38,7 +38,7 @@ if ( ! current_user_can( 'upload_files' ) ) { wp_die( __( 'Sorry, you are not allowed to upload files.' ) ); } -// just fetch the detail form for that attachment +// Just fetch the detail form for that attachment. if ( isset( $_REQUEST['attachment_id'] ) && intval( $_REQUEST['attachment_id'] ) && $_REQUEST['fetch'] ) { $id = intval( $_REQUEST['attachment_id'] ); $post = get_post( $id ); @@ -112,7 +112,7 @@ if ( $_REQUEST['short'] ) { // Short form response - attachment ID only. echo $id; } else { - // Long form response - big chunk of html. + // Long form response - big chunk of HTML. $type = $_REQUEST['type']; /** diff --git a/wp-admin/comment.php b/wp-admin/comment.php index 145cd7a5ea..7678a83d92 100644 --- a/wp-admin/comment.php +++ b/wp-admin/comment.php @@ -137,7 +137,7 @@ switch ( $action ) { break; } - if ( $comment->comment_approved != '0' ) { // if not unapproved + if ( $comment->comment_approved != '0' ) { // If not unapproved. $message = ''; switch ( $comment->comment_approved ) { case '1': @@ -355,6 +355,6 @@ switch ( $action ) { default: wp_die( __( 'Unknown action.' ) ); -} // end switch +} // End switch. include( ABSPATH . 'wp-admin/admin-footer.php' ); diff --git a/wp-admin/credits.php b/wp-admin/credits.php index af4792d2b4..e6e66564ed 100644 --- a/wp-admin/credits.php +++ b/wp-admin/credits.php @@ -133,7 +133,7 @@ include( ABSPATH . 'wp-admin/admin-footer.php' ); return; -// These are strings returned by the API that we want to be translatable +// These are strings returned by the API that we want to be translatable. __( 'Project Leaders' ); /* translators: %s: The current WordPress version number. */ __( 'Core Contributors to WordPress %s' ); diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php index b159c0a179..a03fd00e59 100644 --- a/wp-admin/edit-comments.php +++ b/wp-admin/edit-comments.php @@ -52,7 +52,7 @@ if ( $doaction ) { wp_defer_comment_counting( true ); - foreach ( $comment_ids as $comment_id ) { // Check the permissions on each + foreach ( $comment_ids as $comment_id ) { // Check the permissions on each. if ( ! current_user_can( 'edit_comment', $comment_id ) ) { continue; } diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index e7127fbcb2..20b62af216 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -6,7 +6,7 @@ * @subpackage Administration */ -// don't load directly +// Don't load directly. if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); } @@ -95,7 +95,7 @@ if ( $thumbnail_support ) { wp_enqueue_media( array( 'post' => $post_ID ) ); } -// Add the local autosave notice HTML +// Add the local autosave notice HTML. add_action( 'admin_footer', '_local_storage_notice' ); /* @@ -242,7 +242,7 @@ $form_action = 'editpost'; $nonce_action = 'update-post_' . $post_ID; $form_extra .= ""; -// Detect if there exists an autosave newer than the post and if that autosave is different than the post +// Detect if there exists an autosave newer than the post and if that autosave is different than the post. if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql2date( 'U', $post->post_modified_gmt, false ) ) { foreach ( _wp_post_revision_fields( $post ) as $autosave_field => $_autosave_field ) { if ( normalize_whitespace( $autosave->$autosave_field ) != normalize_whitespace( $post->$autosave_field ) ) { diff --git a/wp-admin/edit-form-blocks.php b/wp-admin/edit-form-blocks.php index dcec9faaab..274325ae74 100644 --- a/wp-admin/edit-form-blocks.php +++ b/wp-admin/edit-form-blocks.php @@ -8,7 +8,7 @@ * @subpackage Administration */ -// don't load directly +// Don't load directly. if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); } @@ -148,10 +148,12 @@ $font_sizes = current( (array) get_theme_support( 'editor-font-sizes' ) ); */ $allowed_block_types = apply_filters( 'allowed_block_types', true, $post ); -// Get all available templates for the post/page attributes meta-box. -// The "Default template" array element should only be added if the array is -// not empty so we do not trigger the template select element without any options -// besides the default value. +/* + * Get all available templates for the post/page attributes meta-box. + * The "Default template" array element should only be added if the array is + * not empty so we do not trigger the template select element without any options + * besides the default value. + */ $available_templates = wp_get_theme()->get_page_templates( get_post( $post->ID ) ); $available_templates = ! empty( $available_templates ) ? array_merge( array( diff --git a/wp-admin/edit-form-comment.php b/wp-admin/edit-form-comment.php index aaed1f9fa4..43b568a0aa 100644 --- a/wp-admin/edit-form-comment.php +++ b/wp-admin/edit-form-comment.php @@ -6,7 +6,7 @@ * @subpackage Administration */ -// don't load directly +// Don't load directly. if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); } diff --git a/wp-admin/edit-link-form.php b/wp-admin/edit-link-form.php index 05c3751f72..13cc68ae05 100644 --- a/wp-admin/edit-link-form.php +++ b/wp-admin/edit-link-form.php @@ -6,7 +6,7 @@ * @subpackage Administration */ -// don't load directly +// Don't load directly. if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); } diff --git a/wp-admin/edit-tag-form.php b/wp-admin/edit-tag-form.php index a56ee93ff7..42350b709a 100644 --- a/wp-admin/edit-tag-form.php +++ b/wp-admin/edit-tag-form.php @@ -6,12 +6,12 @@ * @subpackage Administration */ -// don't load directly +// Don't load directly. if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); } -// Back compat hooks +// Back compat hooks. if ( 'category' == $taxonomy ) { /** * Fires before the Edit Category form. @@ -191,7 +191,7 @@ if ( isset( $tag->name ) ) {
name ) ) { ?> current_action() ) { $tags = (array) $_REQUEST['delete_tags']; /** This action is documented in wp-admin/edit.php */ - $location = apply_filters( "handle_bulk_actions-{$screen}", $location, $wp_list_table->current_action(), $tags ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores + $location = apply_filters( "handle_bulk_actions-{$screen}", $location, $wp_list_table->current_action(), $tags ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores break; } diff --git a/wp-admin/edit.php b/wp-admin/edit.php index 5c818f4e4c..0584e7fe6d 100644 --- a/wp-admin/edit.php +++ b/wp-admin/edit.php @@ -47,7 +47,7 @@ if ( ! current_user_can( $post_type_object->cap->edit_posts ) ) { $wp_list_table = _get_list_table( 'WP_Posts_List_Table' ); $pagenum = $wp_list_table->get_pagenum(); -// Back-compat for viewing comments of an entry +// Back-compat for viewing comments of an entry. foreach ( array( 'p', 'attachment_id', 'page_id' ) as $_redirect ) { if ( ! empty( $_REQUEST[ $_redirect ] ) ) { wp_redirect( admin_url( 'edit-comments.php?p=' . absint( $_REQUEST[ $_redirect ] ) ) ); diff --git a/wp-admin/import.php b/wp-admin/import.php index d10f60bde7..cc4246d65c 100644 --- a/wp-admin/import.php +++ b/wp-admin/import.php @@ -39,7 +39,7 @@ if ( current_user_can( 'install_plugins' ) ) { $popular_importers = array(); } -// Detect and redirect invalid importers like 'movabletype', which is registered as 'mt' +// Detect and redirect invalid importers like 'movabletype', which is registered as 'mt'. if ( ! empty( $_GET['invalid'] ) && isset( $popular_importers[ $_GET['invalid'] ] ) ) { $importer_id = $popular_importers[ $_GET['invalid'] ]['importer-id']; if ( $importer_id != $_GET['invalid'] ) { // Prevent redirect loops. @@ -93,7 +93,7 @@ foreach ( $popular_importers as $pop_importer => $pop_data ) { } if ( empty( $importers ) ) { - echo '' . __( 'No importers are available.' ) . '
'; // TODO: make more helpful + echo '' . __( 'No importers are available.' ) . '
'; // TODO: Make more helpful. } else { uasort( $importers, '_usort_by_first_member' ); ?> diff --git a/wp-admin/includes/admin-filters.php b/wp-admin/includes/admin-filters.php index c080fd0f24..4e66b28bb8 100644 --- a/wp-admin/includes/admin-filters.php +++ b/wp-admin/includes/admin-filters.php @@ -128,7 +128,7 @@ add_action( 'upgrader_process_complete', 'wp_version_check', 10, 0 ); add_action( 'upgrader_process_complete', 'wp_update_plugins', 10, 0 ); add_action( 'upgrader_process_complete', 'wp_update_themes', 10, 0 ); -// Privacy hooks +// Privacy hooks. add_filter( 'wp_privacy_personal_data_erasure_page', 'wp_privacy_process_personal_data_erasure_page', 10, 5 ); add_filter( 'wp_privacy_personal_data_export_page', 'wp_privacy_process_personal_data_export_page', 10, 7 ); add_action( 'wp_privacy_personal_data_export_file', 'wp_privacy_generate_personal_data_export_file', 10 ); diff --git a/wp-admin/includes/admin.php b/wp-admin/includes/admin.php index 8c3a3eb156..43f0014eb2 100644 --- a/wp-admin/includes/admin.php +++ b/wp-admin/includes/admin.php @@ -74,7 +74,7 @@ require_once( ABSPATH . 'wp-admin/includes/theme.php' ); require_once( ABSPATH . 'wp-admin/includes/privacy-tools.php' ); /** WordPress Privacy List Table classes. */ -// Previously in wp-admin/includes/user.php. Need to be loaded for backwards compatibility. +// Previously in wp-admin/includes/user.php. Need to be loaded for backward compatibility. require_once( ABSPATH . 'wp-admin/includes/class-wp-privacy-requests-table.php' ); require_once( ABSPATH . 'wp-admin/includes/class-wp-privacy-data-export-requests-list-table.php' ); require_once( ABSPATH . 'wp-admin/includes/class-wp-privacy-data-removal-requests-list-table.php' ); diff --git a/wp-admin/includes/ajax-actions.php b/wp-admin/includes/ajax-actions.php index 495693c313..f230290bb9 100644 --- a/wp-admin/includes/ajax-actions.php +++ b/wp-admin/includes/ajax-actions.php @@ -22,7 +22,7 @@ function wp_ajax_nopriv_heartbeat() { $response = array(); - // screen_id is the same as $current_screen->id and the JS global 'pagenow'. + // 'screen_id' is the same as $current_screen->id and the JS global 'pagenow'. if ( ! empty( $_POST['screen_id'] ) ) { $screen_id = sanitize_key( $_POST['screen_id'] ); } else { @@ -272,23 +272,23 @@ function wp_ajax_autocomplete_user() { $return = array(); - // Check the type of request - // Current allowed values are `add` and `search` + // Check the type of request. + // Current allowed values are `add` and `search`. if ( isset( $_REQUEST['autocomplete_type'] ) && 'search' === $_REQUEST['autocomplete_type'] ) { $type = $_REQUEST['autocomplete_type']; } else { $type = 'add'; } - // Check the desired field for value - // Current allowed values are `user_email` and `user_login` + // Check the desired field for value. + // Current allowed values are `user_email` and `user_login`. if ( isset( $_REQUEST['autocomplete_field'] ) && 'user_email' === $_REQUEST['autocomplete_field'] ) { $field = $_REQUEST['autocomplete_field']; } else { $field = 'user_login'; } - // Exclude current users of this blog + // Exclude current users of this blog. if ( isset( $_REQUEST['site_id'] ) ) { $id = absint( $_REQUEST['site_id'] ); } else { @@ -433,7 +433,7 @@ function _wp_ajax_delete_comment_response( $comment_id, $delta = -1 ) { $page = isset( $_POST['_page'] ) ? (int) $_POST['_page'] : 0; $url = isset( $_POST['_url'] ) ? esc_url_raw( $_POST['_url'] ) : ''; - // JS didn't send us everything we need to know. Just die with success message + // JS didn't send us everything we need to know. Just die with success message. if ( ! $total || ! $per_page || ! $page || ! $url ) { $time = time(); $comment = get_comment( $comment_id ); @@ -482,7 +482,7 @@ function _wp_ajax_delete_comment_response( $comment_id, $delta = -1 ) { $total = 0; } - // Only do the expensive stuff on a page-break, and about 1 other time per page + // Only do the expensive stuff on a page-break, and about 1 other time per page. if ( 0 == $total % $per_page || 1 == mt_rand( 1, $per_page ) ) { $post_id = 0; // What type of comment count are we looking for? @@ -600,7 +600,7 @@ function _wp_ajax_add_hierarchical_term() { $checked_categories[] = $cat_id; - if ( $parent ) { // Do these all at once in a second + if ( $parent ) { // Do these all at once in a second. continue; } @@ -626,11 +626,11 @@ function _wp_ajax_add_hierarchical_term() { ); } - if ( $parent ) { // Foncy - replace the parent and all its children + if ( $parent ) { // Foncy - replace the parent and all its children. $parent = get_term( $parent, $taxonomy->name ); $term_id = $parent->term_id; - while ( $parent->parent ) { // get the top parent + while ( $parent->parent ) { // Get the top parent. $parent = get_term( $parent->parent, $taxonomy->name ); if ( is_wp_error( $parent ) ) { break; @@ -716,7 +716,8 @@ function wp_ajax_delete_comment() { $r = wp_untrash_comment( $comment ); - if ( ! isset( $_POST['comment_status'] ) || $_POST['comment_status'] != 'trash' ) { // undo trash, not in trash + // Undo trash, not in trash. + if ( ! isset( $_POST['comment_status'] ) || $_POST['comment_status'] != 'trash' ) { $delta = 1; } } elseif ( isset( $_POST['spam'] ) && 1 == $_POST['spam'] ) { @@ -732,7 +733,8 @@ function wp_ajax_delete_comment() { $r = wp_unspam_comment( $comment ); - if ( ! isset( $_POST['comment_status'] ) || $_POST['comment_status'] != 'spam' ) { // undo spam, not in spam + // Undo spam, not in spam. + if ( ! isset( $_POST['comment_status'] ) || $_POST['comment_status'] != 'spam' ) { $delta = 1; } } elseif ( isset( $_POST['delete'] ) && 1 == $_POST['delete'] ) { @@ -741,7 +743,8 @@ function wp_ajax_delete_comment() { wp_die( -1 ); } - if ( $r ) { // Decide if we need to send back '1' or a more complicated response including page links and comment counts + if ( $r ) { + // Decide if we need to send back '1' or a more complicated response including page links and comment counts. _wp_ajax_delete_comment_response( $comment->comment_ID, $delta ); } @@ -989,7 +992,7 @@ function wp_ajax_dim_comment() { $x->send(); } - // Decide if we need to send back '1' or a more complicated response including page links and comment counts + // Decide if we need to send back '1' or a more complicated response including page links and comment counts. _wp_ajax_delete_comment_response( $comment->comment_ID ); wp_die( 0 ); } @@ -1161,7 +1164,7 @@ function wp_ajax_get_tagcloud() { $tags[ $key ]->id = $tag->term_id; } - // We need raw tag names here, so don't filter the output + // We need raw tag names here, so don't filter the output. $return = wp_generate_tag_cloud( $tags, array( @@ -1288,8 +1291,8 @@ function wp_ajax_replyto_comment( $action ) { } if ( wp_create_nonce( 'unfiltered-html-comment' ) != $_POST['_wp_unfiltered_html_comment'] ) { - kses_remove_filters(); // start with a clean slate - kses_init_filters(); // set up the filters + kses_remove_filters(); // Start with a clean slate. + kses_init_filters(); // Set up the filters. remove_filter( 'pre_comment_content', 'wp_filter_post_kses' ); add_filter( 'pre_comment_content', 'wp_filter_kses' ); } @@ -1478,7 +1481,7 @@ function wp_ajax_add_menu_item() { $_menu_items = array_map( 'wp_setup_nav_menu_item', array( $_object ) ); $_menu_item = reset( $_menu_items ); - // Restore the missing menu item properties + // Restore the missing menu item properties. $menu_item_data['menu-item-description'] = $_menu_item->description; } @@ -1498,7 +1501,7 @@ function wp_ajax_add_menu_item() { if ( ! empty( $menu_obj->ID ) ) { $menu_obj = wp_setup_nav_menu_item( $menu_obj ); $menu_obj->title = empty( $menu_obj->title ) ? __( 'Menu Item' ) : $menu_obj->title; - $menu_obj->label = $menu_obj->title; // don't show "(pending)" in ajax-added items + $menu_obj->label = $menu_obj->title; // Don't show "(pending)" in ajax-added items. $menu_items[] = $menu_obj; } } @@ -1548,7 +1551,7 @@ function wp_ajax_add_meta() { // If the post is an autodraft, save the post as a draft and then attempt to save the meta. if ( $post->post_status == 'auto-draft' ) { $post_data = array(); - $post_data['action'] = 'draft'; // Warning fix + $post_data['action'] = 'draft'; // Warning fix. $post_data['post_ID'] = $pid; $post_data['post_type'] = $post->post_type; $post_data['post_status'] = 'draft'; @@ -1608,7 +1611,7 @@ function wp_ajax_add_meta() { $meta = get_metadata_by_mid( 'post', $mid ); if ( ! $meta ) { - wp_die( 0 ); // if meta doesn't exist + wp_die( 0 ); // If meta doesn't exist. } if ( @@ -1731,7 +1734,8 @@ function wp_ajax_closed_postboxes() { } if ( is_array( $hidden ) ) { - $hidden = array_diff( $hidden, array( 'submitdiv', 'linksubmitdiv', 'manage-menu', 'create-menu' ) ); // postboxes that are always shown + // Postboxes that are always shown. + $hidden = array_diff( $hidden, array( 'submitdiv', 'linksubmitdiv', 'manage-menu', 'create-menu' ) ); update_user_option( $user->ID, "metaboxhidden_$page", $hidden, true ); } @@ -2620,7 +2624,7 @@ function wp_ajax_image_editor() { * @since 3.1.0 */ function wp_ajax_set_post_thumbnail() { - $json = ! empty( $_REQUEST['json'] ); // New-style request + $json = ! empty( $_REQUEST['json'] ); // New-style request. $post_ID = intval( $_POST['post_id'] ); if ( ! current_user_can( 'edit_post', $post_ID ) ) { @@ -3226,7 +3230,7 @@ function wp_ajax_send_attachment_to_editor() { $html = stripslashes_deep( $_POST['html'] ); } else { $html = isset( $attachment['post_title'] ) ? $attachment['post_title'] : ''; - $rel = $rel ? ' rel="attachment wp-att-' . $id . '"' : ''; // Hard-coded string, $id is already sanitized + $rel = $rel ? ' rel="attachment wp-att-' . $id . '"' : ''; // Hard-coded string, $id is already sanitized. if ( ! empty( $url ) ) { $html = '' . $html . ''; @@ -3287,7 +3291,7 @@ function wp_ajax_send_link_to_editor() { $fallback = $wp_embed->maybe_make_link( $src ); if ( $check_embed !== $fallback ) { - // TinyMCE view for [embed] will parse this + // TinyMCE view for [embed] will parse this. $html = '[embed]' . $src . '[/embed]'; } elseif ( $link_text ) { $html = '' . $link_text . ''; @@ -3327,7 +3331,7 @@ function wp_ajax_heartbeat() { $data = array(); $nonce_state = wp_verify_nonce( $_POST['_nonce'], 'heartbeat-nonce' ); - // screen_id is the same as $current_screen->id and the JS global 'pagenow'. + // 'screen_id' is the same as $current_screen->id and the JS global 'pagenow'. if ( ! empty( $_POST['screen_id'] ) ) { $screen_id = sanitize_key( $_POST['screen_id'] ); } else { @@ -3392,7 +3396,7 @@ function wp_ajax_heartbeat() { */ do_action( 'heartbeat_tick', $response, $screen_id ); - // Send the current time according to the server + // Send the current time according to the server. $response['server_time'] = time(); wp_send_json( $response ); @@ -3735,7 +3739,7 @@ function wp_ajax_parse_media_shortcode() { $post = get_post( (int) $_POST['post_ID'] ); } - // the embed shortcode requires a post + // The embed shortcode requires a post. if ( ! $post || ! current_user_can( 'edit_post', $post->ID ) ) { if ( 'embed' === $shortcode ) { wp_send_json_error(); diff --git a/wp-admin/includes/class-automatic-upgrader-skin.php b/wp-admin/includes/class-automatic-upgrader-skin.php index e3cc207776..9875c6dee5 100644 --- a/wp-admin/includes/class-automatic-upgrader-skin.php +++ b/wp-admin/includes/class-automatic-upgrader-skin.php @@ -41,8 +41,10 @@ class Automatic_Upgrader_Skin extends WP_Upgrader_Skin { if ( $context ) { $this->options['context'] = $context; } - // TODO: fix up request_filesystem_credentials(), or split it, to allow us to request a no-output version - // This will output a credentials form in event of failure, We don't want that, so just hide with a buffer + /* + * TODO: Fix up request_filesystem_credentials(), or split it, to allow us to request a no-output version. + * This will output a credentials form in event of failure. We don't want that, so just hide with a buffer. + */ ob_start(); $result = parent::request_filesystem_credentials( $error, $context, $allow_relaxed_file_ownership ); ob_end_clean(); diff --git a/wp-admin/includes/class-core-upgrader.php b/wp-admin/includes/class-core-upgrader.php index dd3f540dda..328c91de15 100644 --- a/wp-admin/includes/class-core-upgrader.php +++ b/wp-admin/includes/class-core-upgrader.php @@ -115,7 +115,7 @@ class Core_Upgrader extends WP_Upgrader { $to_download = 'full'; } - // Lock to prevent multiple Core Updates occurring + // Lock to prevent multiple Core Updates occurring. $lock = WP_Upgrader::create_lock( 'core_updater', 15 * MINUTE_IN_SECONDS ); if ( ! $lock ) { return new WP_Error( 'locked', $this->strings['locked'] ); @@ -220,7 +220,7 @@ class Core_Upgrader extends WP_Upgrader { ) ); - // Clear the current updates + // Clear the current updates. delete_site_transient( 'update_core' ); if ( ! $parsed_args['do_rollback'] ) { @@ -272,8 +272,9 @@ class Core_Upgrader extends WP_Upgrader { public static function should_update_to_version( $offered_ver ) { include( ABSPATH . WPINC . '/version.php' ); // $wp_version; // x.y.z - $current_branch = implode( '.', array_slice( preg_split( '/[.-]/', $wp_version ), 0, 2 ) ); // x.y - $new_branch = implode( '.', array_slice( preg_split( '/[.-]/', $offered_ver ), 0, 2 ) ); // x.y + $current_branch = implode( '.', array_slice( preg_split( '/[.-]/', $wp_version ), 0, 2 ) ); // x.y + $new_branch = implode( '.', array_slice( preg_split( '/[.-]/', $offered_ver ), 0, 2 ) ); // x.y + $current_is_development_version = (bool) strpos( $wp_version, '-' ); // Defaults: @@ -284,17 +285,17 @@ class Core_Upgrader extends WP_Upgrader { // WP_AUTO_UPDATE_CORE = true (all), 'minor', false. if ( defined( 'WP_AUTO_UPDATE_CORE' ) ) { if ( false === WP_AUTO_UPDATE_CORE ) { - // Defaults to turned off, unless a filter allows it + // Defaults to turned off, unless a filter allows it. $upgrade_dev = false; $upgrade_minor = false; $upgrade_major = false; } elseif ( true === WP_AUTO_UPDATE_CORE ) { - // ALL updates for core + // ALL updates for core. $upgrade_dev = true; $upgrade_minor = true; $upgrade_major = true; } elseif ( 'minor' === WP_AUTO_UPDATE_CORE ) { - // Only minor updates for core + // Only minor updates for core. $upgrade_dev = false; $upgrade_minor = true; $upgrade_major = false; @@ -306,7 +307,7 @@ class Core_Upgrader extends WP_Upgrader { return false; } - // 2: If we're running a newer version, that's a nope + // 2: If we're running a newer version, that's a nope. if ( version_compare( $wp_version, $offered_ver, '>' ) ) { return false; } @@ -323,15 +324,17 @@ class Core_Upgrader extends WP_Upgrader { return false; } - // Cannot update if we're retrying the same A to B update that caused a non-critical failure. - // Some non-critical failures do allow retries, like download_failed. - // 3.7.1 => 3.7.2 resulted in files_not_writable, if we are still on 3.7.1 and still trying to update to 3.7.2. + /* + * Cannot update if we're retrying the same A to B update that caused a non-critical failure. + * Some non-critical failures do allow retries, like download_failed. + * 3.7.1 => 3.7.2 resulted in files_not_writable, if we are still on 3.7.1 and still trying to update to 3.7.2. + */ if ( empty( $failure_data['retry'] ) && $wp_version == $failure_data['current'] && $offered_ver == $failure_data['attempted'] ) { return false; } } - // 3: 3.7-alpha-25000 -> 3.7-alpha-25678 -> 3.7-beta1 -> 3.7-beta2 + // 3: 3.7-alpha-25000 -> 3.7-alpha-25678 -> 3.7-beta1 -> 3.7-beta2. if ( $current_is_development_version ) { /** @@ -348,7 +351,7 @@ class Core_Upgrader extends WP_Upgrader { // Else fall through to minor + major branches below. } - // 4: Minor In-branch updates (3.7.0 -> 3.7.1 -> 3.7.2 -> 3.7.4) + // 4: Minor in-branch updates (3.7.0 -> 3.7.1 -> 3.7.2 -> 3.7.4). if ( $current_branch == $new_branch ) { /** @@ -361,7 +364,7 @@ class Core_Upgrader extends WP_Upgrader { return apply_filters( 'allow_minor_auto_core_updates', $upgrade_minor ); } - // 5: Major version updates (3.7.0 -> 3.8.0 -> 3.9.1) + // 5: Major version updates (3.7.0 -> 3.8.0 -> 3.9.1). if ( version_compare( $new_branch, $current_branch, '>' ) ) { /** @@ -374,7 +377,7 @@ class Core_Upgrader extends WP_Upgrader { return apply_filters( 'allow_major_auto_core_updates', $upgrade_major ); } - // If we're not sure, we don't want it + // If we're not sure, we don't want it. return false; } @@ -398,7 +401,7 @@ class Core_Upgrader extends WP_Upgrader { } foreach ( $checksums as $file => $checksum ) { - // Skip files which get updated + // Skip files which get updated. if ( 'wp-content' == substr( $file, 0, 10 ) ) { continue; } diff --git a/wp-admin/includes/class-custom-background.php b/wp-admin/includes/class-custom-background.php index ea74ef420c..30a05bf607 100644 --- a/wp-admin/includes/class-custom-background.php +++ b/wp-admin/includes/class-custom-background.php @@ -124,7 +124,7 @@ class Custom_Background { } if ( isset( $_POST['remove-background'] ) ) { - // @TODO: Uploaded files are not removed here. + // @todo Uploaded files are not removed here. check_admin_referer( 'custom-background-remove', '_wpnonce-custom-background-remove' ); set_theme_mod( 'background_image', '' ); set_theme_mod( 'background_image_thumb', '' ); @@ -284,7 +284,7 @@ class Custom_Background { . " background-attachment: $background_attachment;"; } ?> -' . $dropins[ $plugin_file ][0] . '
'; - } elseif ( defined( $dropins[ $plugin_file ][1] ) && constant( $dropins[ $plugin_file ][1] ) ) { // Constant is true + } elseif ( defined( $dropins[ $plugin_file ][1] ) && constant( $dropins[ $plugin_file ][1] ) ) { // Constant is true. $is_active = true; $description = '' . $dropins[ $plugin_file ][0] . '
'; } else { @@ -750,9 +750,9 @@ class WP_Plugins_List_Table extends WP_List_Table { __( 'Delete' ) ); } - } // end if $is_active - } // end if $screen->in_admin( 'network' ) - } // end if $context + } // End if $is_active. + } // End if $screen->in_admin( 'network' ). + } // End if $context. $actions = array_filter( $actions ); @@ -906,7 +906,7 @@ class WP_Plugins_List_Table extends WP_List_Table { $plugin_meta[] = sprintf( __( 'By %s' ), $author ); } - // Details link using API info, if available + // Details link using API info, if available. if ( isset( $plugin_data['slug'] ) && current_user_can( 'install_plugins' ) ) { $plugin_meta[] = sprintf( '%s', diff --git a/wp-admin/includes/class-wp-posts-list-table.php b/wp-admin/includes/class-wp-posts-list-table.php index 890d133889..a0f6740e3a 100644 --- a/wp-admin/includes/class-wp-posts-list-table.php +++ b/wp-admin/includes/class-wp-posts-list-table.php @@ -143,7 +143,7 @@ class WP_Posts_List_Table extends WP_List_Table { public function prepare_items() { global $avail_post_stati, $wp_query, $per_page, $mode; - // is going to call wp() + // Is going to call wp(). $avail_post_stati = wp_edit_posts_query(); $this->set_hierarchical_display( is_post_type_hierarchical( $this->screen->post_type ) && 'menu_order title' === $wp_query->query['orderby'] ); @@ -877,7 +877,7 @@ class WP_Posts_List_Table extends WP_List_Table { $my_parents = array(); $my_parent = $page->post_parent; while ( $my_parent ) { - // Get the ID from the list or the attribute if my_parent is an object + // Get the ID from the list or the attribute if my_parent is an object. $parent_id = $my_parent; if ( is_object( $my_parent ) ) { $parent_id = $my_parent->ID; @@ -906,7 +906,7 @@ class WP_Posts_List_Table extends WP_List_Table { $this->_page_rows( $children_pages, $count, $page->ID, $level + 1, $pagenum, $per_page, $to_display ); } - unset( $children_pages[ $parent ] ); //required in order to keep track of orphans + unset( $children_pages[ $parent ] ); // Required in order to keep track of orphans. } /** @@ -1467,6 +1467,7 @@ class WP_Posts_List_Table extends WP_List_Table { $taxonomy_names = get_object_taxonomies( $screen->post_type ); $hierarchical_taxonomies = array(); $flat_taxonomies = array(); + foreach ( $taxonomy_names as $taxonomy_name ) { $taxonomy = get_taxonomy( $taxonomy_name ); @@ -1507,7 +1508,8 @@ class WP_Posts_List_Table extends WP_List_Table { ?> - get_request_counts(); $total_requests = absint( array_sum( (array) $counts ) ); - // Normalized admin URL + // Normalized admin URL. $admin_url = $this->get_admin_url(); $current_link_attributes = empty( $current_status ) ? ' class="current" aria-current="page"' : ''; diff --git a/wp-admin/includes/class-wp-screen.php b/wp-admin/includes/class-wp-screen.php index dbd796593c..e694e6a06a 100644 --- a/wp-admin/includes/class-wp-screen.php +++ b/wp-admin/includes/class-wp-screen.php @@ -226,7 +226,7 @@ final class WP_Screen { // For those pesky meta boxes. if ( $hook_name && post_type_exists( $hook_name ) ) { $post_type = $id; - $id = 'post'; // changes later. ends up being $base. + $id = 'post'; // Changes later. Ends up being $base. } else { if ( '.php' == substr( $id, -4 ) ) { $id = substr( $id, 0, -4 ); @@ -923,7 +923,7 @@ final class WP_Screen {