Make WordPress Core

Changeset 56176


Ignore:
Timestamp:
07/09/2023 08:05:43 PM (16 months ago)
Author:
audrasjb
Message:

Docs: Replace multiple single line comments with multi-line comments.

This changeset updates various comments as per WordPress PHP Inline Documentation Standards.
See https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/#5-inline-comments.

Follow-up to [56174], [56175].

Props costdev, audrasjb.
See #58459.

Location:
trunk/src/wp-admin/includes
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/ms.php

    r55753 r56176  
    10061006    var languageSelect = $( '#WPLANG' );
    10071007    $( 'form' ).on( 'submit', function() {
    1008         // Don't show a spinner for English and installed languages,
    1009         // as there is nothing to download.
     1008        /*
     1009         * Don't show a spinner for English and installed languages,
     1010         * as there is nothing to download.
     1011         */
    10101012        if ( ! languageSelect.find( 'option:selected' ).data( 'installed' ) ) {
    10111013            $( '#submit', this ).after( '<span class="spinner language-install-spinner is-active" />' );
  • trunk/src/wp-admin/includes/nav-menu.php

    r55616 r56176  
    15031503    if ( ! is_null( $data ) && $data ) {
    15041504        foreach ( $data as $post_input_data ) {
    1505             // For input names that are arrays (e.g. `menu-item-db-id[3][4][5]`),
    1506             // derive the array path keys via regex and set the value in $_POST.
     1505            /*
     1506             * For input names that are arrays (e.g. `menu-item-db-id[3][4][5]`),
     1507             * derive the array path keys via regex and set the value in $_POST.
     1508             */
    15071509            preg_match( '#([^\[]*)(\[(.+)\])?#', $post_input_data->name, $matches );
    15081510
  • trunk/src/wp-admin/includes/options.php

    r55414 r56176  
    9191        var languageSelect = $( '#WPLANG' );
    9292        $( 'form' ).on( 'submit', function() {
    93             // Don't show a spinner for English and installed languages,
    94             // as there is nothing to download.
     93            /*
     94             * Don't show a spinner for English and installed languages,
     95             * as there is nothing to download.
     96             */
    9597            if ( ! languageSelect.find( 'option:selected' ).data( 'installed' ) ) {
    9698                $( '#submit', this ).after( '<span class="spinner language-install-spinner is-active" />' );
  • trunk/src/wp-admin/includes/plugin-install.php

    r55276 r56176  
    487487            } else {
    488488                $key = array_keys( $installed_plugin );
    489                 // Use the first plugin regardless of the name.
    490                 // Could have issues for multiple plugins in one directory if they share different version numbers.
     489                /*
     490                 * Use the first plugin regardless of the name.
     491                 * Could have issues for multiple plugins in one directory if they share different version numbers.
     492                 */
    491493                $key = reset( $key );
    492494
  • trunk/src/wp-admin/includes/plugin.php

    r55990 r56176  
    179179    );
    180180
    181     // Name is marked up inside <a> tags. Don't allow these.
    182     // Author is too, but some plugins have used <a> here (omitting Author URI).
     181    /*
     182     * Name is marked up inside <a> tags. Don't allow these.
     183     * Author is too, but some plugins have used <a> here (omitting Author URI).
     184     */
    183185    $plugin_data['Name']   = wp_kses( $plugin_data['Name'], $allowed_tags_in_links );
    184186    $plugin_data['Author'] = wp_kses( $plugin_data['Author'], $allowed_tags );
     
    970972        $this_plugin_dir = trailingslashit( dirname( $plugins_dir . $plugin_file ) );
    971973
    972         // If plugin is in its own directory, recursively delete the directory.
    973         // Base check on if plugin includes directory separator AND that it's not the root plugin folder.
     974        /*
     975         * If plugin is in its own directory, recursively delete the directory.
     976         * Base check on if plugin includes directory separator AND that it's not the root plugin folder.
     977         */
    974978        if ( strpos( $plugin_file, '/' ) && $this_plugin_dir !== $plugins_dir ) {
    975979            $deleted = $wp_filesystem->delete( $this_plugin_dir, true );
  • trunk/src/wp-admin/includes/post.php

    r56123 r56176  
    136136    $published_statuses = array( 'publish', 'future' );
    137137
    138     // Posts 'submitted for approval' are submitted to $_POST the same as if they were being published.
    139     // Change status from 'publish' to 'pending' if user lacks permissions to publish or to resave published posts.
     138    /*
     139     * Posts 'submitted for approval' are submitted to $_POST the same as if they were being published.
     140     * Change status from 'publish' to 'pending' if user lacks permissions to publish or to resave published posts.
     141     */
    140142    if ( isset( $post_data['post_status'] )
    141143        && ( in_array( $post_data['post_status'], $published_statuses, true )
     
    14441446    }
    14451447
    1446     // If the user wants to set a new name -- override the current one.
    1447     // Note: if empty name is supplied -- use the title instead, see #6072.
     1448    /*
     1449     * If the user wants to set a new name -- override the current one.
     1450     * Note: if empty name is supplied -- use the title instead, see #6072.
     1451     */
    14481452    if ( ! is_null( $name ) ) {
    14491453        $post->post_name = sanitize_title( $name ? $name : $title, $post->ID );
     
    20742078        return edit_post( wp_slash( $post_data ) );
    20752079    } else {
    2076         // Non-drafts or other users' drafts are not overwritten.
    2077         // The autosave is stored in a special post revision for each user.
     2080        /*
     2081         * Non-drafts or other users' drafts are not overwritten.
     2082         * The autosave is stored in a special post revision for each user.
     2083         */
    20782084        return wp_create_post_autosave( wp_slash( $post_data ) );
    20792085    }
  • trunk/src/wp-admin/includes/revision.php

    r54939 r56176  
    4040    }
    4141
    42     // If comparing revisions, make sure we're dealing with the right post parent.
    43     // The parent post may be a 'revision' when revisions are disabled and we're looking at autosaves.
     42    /*
     43     * If comparing revisions, make sure we are dealing with the right post parent.
     44     * The parent post may be a 'revision' when revisions are disabled and we're looking at autosaves.
     45     */
    4446    if ( $compare_from && $compare_from->post_parent !== $post->ID && $compare_from->ID !== $post->ID ) {
    4547        return false;
     
    119121
    120122        if ( ! $diff && 'post_title' === $field ) {
    121             // It's a better user experience to still show the Title, even if it didn't change.
    122             // No, you didn't see this.
     123            /*
     124             * It's a better user experience to still show the Title, even if it didn't change.
     125             * No, you didn't see this.
     126             */
    123127            $diff = '<table class="diff"><colgroup><col class="content diffsplit left"><col class="content diffsplit middle"><col class="content diffsplit right"></colgroup><tbody><tr>';
    124128
  • trunk/src/wp-admin/includes/schema.php

    r55869 r56176  
    549549        'auto_update_core_dev'            => 'enabled',
    550550        'auto_update_core_minor'          => 'enabled',
    551         // Default to enabled for new installs.
    552         // See https://core.trac.wordpress.org/ticket/51742.
     551        /*
     552         * Default to enabled for new installs.
     553         * See https://core.trac.wordpress.org/ticket/51742.
     554         */
    553555        'auto_update_core_major'          => 'enabled',
    554556
  • trunk/src/wp-admin/includes/template.php

    r56018 r56176  
    166166
    167167    if ( $parsed_args['checked_ontop'] ) {
    168         // Post-process $categories rather than adding an exclude to the get_terms() query
    169         // to keep the query the same across all posts (for any query cache).
     168        /*
     169         * Post-process $categories rather than adding an exclude to the get_terms() query
     170         * to keep the query the same across all posts (for any query cache).
     171         */
    170172        $checked_categories = array();
    171173        $keys               = array_keys( $categories );
     
    13021304    printf( '<div id="%s-sortables" class="meta-box-sortables">', esc_attr( $context ) );
    13031305
    1304     // Grab the ones the user has manually sorted.
    1305     // Pull them out of their previous context/priority and into the one the user chose.
     1306    /*
     1307     * Grab the ones the user has manually sorted.
     1308     * Pull them out of their previous context/priority and into the one the user chose.
     1309     */
    13061310    $sorted = get_user_option( "meta-box-order_$page" );
    13071311
  • trunk/src/wp-admin/includes/update-core.php

    r56088 r56176  
    12301230    apply_filters( 'update_feedback', __( 'Preparing to install the latest version&#8230;' ) );
    12311231
    1232     // Don't copy wp-content, we'll deal with that below.
    1233     // We also copy version.php last so failed updates report their old version.
     1232    /*
     1233     * Don't copy wp-content, we'll deal with that below.
     1234     * We also copy version.php last so failed updates report their old version.
     1235     */
    12341236    $skip              = array( 'wp-content', 'wp-includes/version.php' );
    12351237    $check_is_writable = array();
     
    13981400        }
    13991401
    1400         // If we don't have enough free space, it isn't worth trying again.
    1401         // Unlikely to be hit due to the check in unzip_file().
     1402        /*
     1403         * If we don't have enough free space, it isn't worth trying again.
     1404         * Unlikely to be hit due to the check in unzip_file().
     1405         */
    14021406        $available_space = function_exists( 'disk_free_space' ) ? @disk_free_space( ABSPATH ) : false;
    14031407
     
    14171421    }
    14181422
    1419     // Custom content directory needs updating now.
    1420     // Copy languages.
     1423    /*
     1424     * Custom content directory needs updating now.
     1425     * Copy languages.
     1426     */
    14211427    if ( ! is_wp_error( $result ) && $wp_filesystem->is_dir( $from . $distro . 'wp-content/languages' ) ) {
    14221428        if ( WP_LANG_DIR !== ABSPATH . WPINC . '/languages' || @is_dir( WP_LANG_DIR ) ) {
     
    14561462    $wp_filesystem->delete( $maintenance_file );
    14571463
    1458     // 3.5 -> 3.5+ - an empty twentytwelve directory was created upon upgrade to 3.5 for some users,
    1459     // preventing installation of Twenty Twelve.
     1464    /*
     1465     * 3.5 -> 3.5+ - an empty twentytwelve directory was created upon upgrade to 3.5 for some users,
     1466     * preventing installation of Twenty Twelve.
     1467     */
    14601468    if ( '3.5' === $old_wp_version ) {
    14611469        if ( is_dir( WP_CONTENT_DIR . '/themes/twentytwelve' )
  • trunk/src/wp-admin/includes/upgrade.php

    r56044 r56176  
    441441            $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->usermeta WHERE user_id != %d AND meta_key = %s", $user_id, $table_prefix . 'capabilities' ) );
    442442
    443             // Delete any caps that snuck into the previously active blog. (Hardcoded to blog 1 for now.)
    444             // TODO: Get previous_blog_id.
     443            /*
     444             * Delete any caps that snuck into the previously active blog. (Hardcoded to blog 1 for now.)
     445             * TODO: Get previous_blog_id.
     446             */
    445447            if ( ! is_super_admin( $user_id ) && 1 != $user_id ) {
    446448                $wpdb->delete(
     
    16451647
    16461648    if ( $wp_current_db_version < 11958 ) {
    1647         // Previously, setting depth to 1 would redundantly disable threading,
    1648         // but now 2 is the minimum depth to avoid confusion.
     1649        /*
     1650         * Previously, setting depth to 1 would redundantly disable threading,
     1651         * but now 2 is the minimum depth to avoid confusion.
     1652         */
    16491653        if ( get_option( 'thread_comments_depth' ) == '1' ) {
    16501654            update_option( 'thread_comments_depth', 2 );
     
    33323336    $default_dir = WP_CONTENT_DIR . '/themes/' . WP_DEFAULT_THEME;
    33333337
    3334     // Copy files from the default theme to the site theme.
    3335     // $files = array( 'index.php', 'comments.php', 'comments-popup.php', 'footer.php', 'header.php', 'sidebar.php', 'style.css' );
     3338    /*
     3339     * Copy files from the default theme to the site theme.
     3340     * $files = array( 'index.php', 'comments.php', 'comments-popup.php', 'footer.php', 'header.php', 'sidebar.php', 'style.css' );
     3341     */
    33363342
    33373343    $theme_dir = @opendir( $default_dir );
Note: See TracChangeset for help on using the changeset viewer.