Make WordPress Core

Changeset 56177


Ignore:
Timestamp:
07/09/2023 08:15:03 PM (3 years 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], [56176].

Props costdev, audrasjb.
See #58459.

Location:
trunk/src/wp-includes
Files:
9 edited

Legend:

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

    r55398 r56177  
    405405                case 'link_category': // array( ints )
    406406                        $value = array_map( 'absint', (array) $value );
    407                         // We return here so that the categories aren't filtered.
    408                         // The 'link_category' filter is for the name of a link category, not an array of a link's link categories.
     407                        /*
     408                         * We return here so that the categories aren't filtered.
     409                         * The 'link_category' filter is for the name of a link category, not an array of a link's link categories.
     410                         */
    409411                        return $value;
    410412
  • trunk/src/wp-includes/canonical.php

    r55988 r56177  
    4747        }
    4848
    49         // If we're not in wp-admin and the post has been published and preview nonce
    50         // is non-existent or invalid then no need for preview in query.
     49        /*
     50         * If we're not in wp-admin and the post has been published and preview nonce
     51         * is non-existent or invalid then no need for preview in query.
     52         */
    5153        if ( is_preview() && get_query_var( 'p' ) && 'publish' === get_post_status( get_query_var( 'p' ) ) ) {
    5254                if ( ! isset( $_GET['preview_id'] )
    … …  
    690692        $redirect_host_low = strtolower( $redirect['host'] );
    691693
    692         // Ignore differences in host capitalization, as this can lead to infinite redirects.
    693         // Only redirect no-www <=> yes-www.
     694        /*
     695         * Ignore differences in host capitalization, as this can lead to infinite redirects.
     696         * Only redirect no-www <=> yes-www.
     697         */
    694698        if ( $original_host_low === $redirect_host_low
    695699                || ( 'www.' . $original_host_low !== $redirect_host_low
  • trunk/src/wp-includes/capabilities.php

    r54891 r56177  
    173173
    174174                        break;
    175                 // edit_post breaks down to edit_posts, edit_published_posts, or
    176                 // edit_others_posts.
     175                /*
     176                 * edit_post breaks down to edit_posts, edit_published_posts, or
     177                 * edit_others_posts.
     178                 */
    177179                case 'edit_post':
    178180                case 'edit_page':
    … …  
    618620                case 'upload_themes':
    619621                case 'update_core':
    620                         // Disallow anything that creates, deletes, or updates core, plugin, or theme files.
    621                         // Files in uploads are excepted.
     622                        /*
     623                         * Disallow anything that creates, deletes, or updates core, plugin, or theme files.
     624                         * Files in uploads are excepted.
     625                         */
    622626                        if ( ! wp_is_file_mod_allowed( 'capability_update_core' ) ) {
    623627                                $caps[] = 'do_not_allow';
  • trunk/src/wp-includes/class-wp-admin-bar.php

    r55580 r56177  
    314314                }
    315315
    316                 // Add the root node.
    317                 // Clear it first, just in case. Don't mess with The Root.
     316                /*
     317                 * Add the root node.
     318                 * Clear it first, just in case. Don't mess with The Root.
     319                 */
    318320                $this->remove_node( 'root' );
    319321                $this->add_node(
    … …  
    363365                                $default    = $this->_get_node( $default_id );
    364366
    365                                 // The default group is added here to allow groups that are
    366                                 // added before standard menu items to render first.
     367                                /*
     368                                 * The default group is added here to allow groups that are
     369                                 * added before standard menu items to render first.
     370                                 */
    367371                                if ( ! $default ) {
    368                                         // Use _set_node because add_node can be overloaded.
    369                                         // Make sure to specify default settings for all properties.
     372                                        /*
     373                                         * Use _set_node because add_node can be overloaded.
     374                                         * Make sure to specify default settings for all properties.
     375                                         */
    370376                                        $this->_set_node(
    371377                                                array(
    … …  
    386392                                $parent = $default;
    387393
    388                                 // Groups in groups aren't allowed. Add a special 'container' node.
    389                                 // The container will invisibly wrap both groups.
     394                                /*
     395                                 * Groups in groups aren't allowed. Add a special 'container' node.
     396                                 * The container will invisibly wrap both groups.
     397                                 */
    390398                        } elseif ( 'group' === $parent->type && 'group' === $node->type ) {
    391399                                $container_id = $parent->id . '-container';
    … …  
    394402                                // We need to create a container for this group, life is sad.
    395403                                if ( ! $container ) {
    396                                         // Use _set_node because add_node can be overloaded.
    397                                         // Make sure to specify default settings for all properties.
     404                                        /*
     405                                         * Use _set_node because add_node can be overloaded.
     406                                         * Make sure to specify default settings for all properties.
     407                                         */
    398408                                        $this->_set_node(
    399409                                                array(
    … …  
    448458         */
    449459        final protected function _render( $root ) {
    450                 // Add browser classes.
    451                 // We have to do this here since admin bar shows on the front end.
     460                /*
     461                 * Add browser classes.
     462                 * We have to do this here since admin bar shows on the front end.
     463                 */
    452464                $class = 'nojq nojs';
    453465                if ( wp_is_mobile() ) {
  • trunk/src/wp-includes/class-wp-customize-control.php

    r55276 r56177  
    608608                                $dropdown = str_replace( '<select', '<select ' . $this->get_link() . ' id="' . esc_attr( $input_id ) . '" ' . $describedby_attr, $dropdown );
    609609
    610                                 // Even more hacikly add auto-draft page stubs.
    611                                 // @todo Eventually this should be removed in favor of the pages being injected into the underlying get_pages() call. See <https://github.com/xwp/wp-customize-posts/pull/250>.
     610                                /*
     611                                 * Even more hacikly add auto-draft page stubs.
     612                                 * @todo Eventually this should be removed in favor of the pages being injected into the underlying get_pages() call.
     613                                 * See <https://github.com/xwp/wp-customize-posts/pull/250>.
     614                                 */
    612615                                $nav_menus_created_posts_setting = $this->manager->get_setting( 'nav_menus_created_posts' );
    613616                                if ( $nav_menus_created_posts_setting && current_user_can( 'publish_pages' ) ) {
  • trunk/src/wp-includes/class-wp-customize-manager.php

    r55990 r56177  
    272272                }
    273273
    274                 // The theme and messenger_channel should be supplied via $args,
    275                 // but they are also looked at in the $_REQUEST global here for back-compat.
     274                /*
     275                 * The theme and messenger_channel should be supplied via $args,
     276                 * but they are also looked at in the $_REQUEST global here for back-compat.
     277                 */
    276278                if ( ! isset( $args['theme'] ) ) {
    277279                        if ( isset( $_REQUEST['customize_theme'] ) ) {
    … …  
    566568                        add_action( 'after_setup_theme', array( $this, 'after_setup_theme' ) );
    567569                } else {
    568                         // If the requested theme is not the active theme and the user doesn't have
    569                         // the switch_themes cap, bail.
     570                        /*
     571                         * If the requested theme is not the active theme and the user doesn't have
     572                         * the switch_themes cap, bail.
     573                         */
    570574                        if ( ! current_user_can( 'switch_themes' ) ) {
    571575                                $this->wp_die( -1, __( 'Sorry, you are not allowed to edit theme options on this site.' ) );
    … …  
    906910        public function wp_loaded() {
    907911
    908                 // Unconditionally register core types for panels, sections, and controls
    909                 // in case plugin unhooks all customize_register actions.
     912                /*
     913                 * Unconditionally register core types for panels, sections, and controls
     914                 * in case plugin unhooks all customize_register actions.
     915                 */
    910916                $this->register_panel_type( 'WP_Customize_Panel' );
    911917                $this->register_panel_type( 'WP_Customize_Themes_Panel' );
    … …  
    52705276                );
    52715277
    5272                 // Input type: checkbox.
    5273                 // With custom value.
     5278                // Input type: checkbox, with custom value.
    52745279                $this->add_control(
    52755280                        'display_header_text',
    … …  
    52945299                );
    52955300
    5296                 // Input type: color.
    5297                 // With sanitize_callback.
     5301                // Input type: color, with sanitize_callback.
    52985302                $this->add_setting(
    52995303                        'background_color',
    … …  
    56035607                );
    56045608
    5605                 // If the theme is using the default background callback, we can update
    5606                 // the background CSS using postMessage.
     5609                /*
     5610                 * If the theme is using the default background callback, we can update
     5611                 * the background CSS using postMessage.
     5612                 */
    56075613                if ( get_theme_support( 'custom-background', 'wp-head-callback' ) === '_custom_background_cb' ) {
    56085614                        foreach ( array( 'color', 'image', 'preset', 'position_x', 'position_y', 'size', 'repeat', 'attachment' ) as $prop ) {
  • trunk/src/wp-includes/class-wp-editor.php

    r56031 r56177  
    459459                                        $key = array_search( 'spellchecker', $plugins, true );
    460460                                        if ( false !== $key ) {
    461                                                 // Remove 'spellchecker' from the internal plugins if added with 'tiny_mce_plugins' filter to prevent errors.
    462                                                 // It can be added with 'mce_external_plugins'.
     461                                                /*
     462                                                 * Remove 'spellchecker' from the internal plugins if added with 'tiny_mce_plugins' filter to prevent errors.
     463                                                 * It can be added with 'mce_external_plugins'.
     464                                                 */
    463465                                                unset( $plugins[ $key ] );
    464466                                        }
  • trunk/src/wp-includes/class-wp-embed.php

    r55990 r56177  
    213213                $this->last_attr = $attr;
    214214
    215                 // KSES converts & into &amp; and we need to undo this.
    216                 // See https://core.trac.wordpress.org/ticket/11311
     215                /*
     216                 * KSES converts & into &amp; and we need to undo this.
     217                 * See https://core.trac.wordpress.org/ticket/11311
     218                 */
    217219                $url = str_replace( '&amp;', '&', $url );
    218220
  • trunk/src/wp-includes/class-wp-image-editor-gd.php

    r54226 r56177  
    325325         */
    326326        public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = null, $src_abs = false ) {
    327                 // If destination width/height isn't specified,
    328                 // use same as width/height from source.
     327                /*
     328                 * If destination width/height isn't specified,
     329                 * use same as width/height from source.
     330                 */
    329331                if ( ! $dst_w ) {
    330332                        $dst_w = $src_w;
Note: See TracChangeset for help on using the changeset viewer.