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.



Built from https://develop.svn.wordpress.org/trunk@56177


git-svn-id: http://core.svn.wordpress.org/trunk@55689 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
audrasjb 2023-07-09 20:17:29 +00:00
parent 145060e3c0
commit 2697e5bf6e
10 changed files with 80 additions and 43 deletions

View File

@ -404,8 +404,10 @@ function sanitize_bookmark_field( $field, $value, $bookmark_id, $context ) {
switch ( $field ) {
case 'link_category': // array( ints )
$value = array_map( 'absint', (array) $value );
// We return here so that the categories aren't filtered.
// The 'link_category' filter is for the name of a link category, not an array of a link's link categories.
/*
* We return here so that the categories aren't filtered.
* The 'link_category' filter is for the name of a link category, not an array of a link's link categories.
*/
return $value;
case 'link_visible': // bool stored as Y|N

View File

@ -46,8 +46,10 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
return;
}
// If we're not in wp-admin and the post has been published and preview nonce
// is non-existent or invalid then no need for preview in query.
/*
* If we're not in wp-admin and the post has been published and preview nonce
* is non-existent or invalid then no need for preview in query.
*/
if ( is_preview() && get_query_var( 'p' ) && 'publish' === get_post_status( get_query_var( 'p' ) ) ) {
if ( ! isset( $_GET['preview_id'] )
|| ! isset( $_GET['preview_nonce'] )
@ -689,8 +691,10 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
$original_host_low = strtolower( $original['host'] );
$redirect_host_low = strtolower( $redirect['host'] );
// Ignore differences in host capitalization, as this can lead to infinite redirects.
// Only redirect no-www <=> yes-www.
/*
* Ignore differences in host capitalization, as this can lead to infinite redirects.
* Only redirect no-www <=> yes-www.
*/
if ( $original_host_low === $redirect_host_low
|| ( 'www.' . $original_host_low !== $redirect_host_low
&& 'www.' . $redirect_host_low !== $original_host_low )

View File

@ -172,8 +172,10 @@ function map_meta_cap( $cap, $user_id, ...$args ) {
}
break;
// edit_post breaks down to edit_posts, edit_published_posts, or
// edit_others_posts.
/*
* edit_post breaks down to edit_posts, edit_published_posts, or
* edit_others_posts.
*/
case 'edit_post':
case 'edit_page':
if ( ! isset( $args[0] ) ) {
@ -617,8 +619,10 @@ function map_meta_cap( $cap, $user_id, ...$args ) {
case 'install_themes':
case 'upload_themes':
case 'update_core':
// Disallow anything that creates, deletes, or updates core, plugin, or theme files.
// Files in uploads are excepted.
/*
* Disallow anything that creates, deletes, or updates core, plugin, or theme files.
* Files in uploads are excepted.
*/
if ( ! wp_is_file_mod_allowed( 'capability_update_core' ) ) {
$caps[] = 'do_not_allow';
} elseif ( is_multisite() && ! is_super_admin( $user_id ) ) {

View File

@ -313,8 +313,10 @@ class WP_Admin_Bar {
return;
}
// Add the root node.
// Clear it first, just in case. Don't mess with The Root.
/*
* Add the root node.
* Clear it first, just in case. Don't mess with The Root.
*/
$this->remove_node( 'root' );
$this->add_node(
array(
@ -362,11 +364,15 @@ class WP_Admin_Bar {
$default_id = $parent->id . '-default';
$default = $this->_get_node( $default_id );
// The default group is added here to allow groups that are
// added before standard menu items to render first.
/*
* The default group is added here to allow groups that are
* added before standard menu items to render first.
*/
if ( ! $default ) {
// Use _set_node because add_node can be overloaded.
// Make sure to specify default settings for all properties.
/*
* Use _set_node because add_node can be overloaded.
* Make sure to specify default settings for all properties.
*/
$this->_set_node(
array(
'id' => $default_id,
@ -385,16 +391,20 @@ class WP_Admin_Bar {
}
$parent = $default;
// Groups in groups aren't allowed. Add a special 'container' node.
// The container will invisibly wrap both groups.
/*
* Groups in groups aren't allowed. Add a special 'container' node.
* The container will invisibly wrap both groups.
*/
} elseif ( 'group' === $parent->type && 'group' === $node->type ) {
$container_id = $parent->id . '-container';
$container = $this->_get_node( $container_id );
// We need to create a container for this group, life is sad.
if ( ! $container ) {
// Use _set_node because add_node can be overloaded.
// Make sure to specify default settings for all properties.
/*
* Use _set_node because add_node can be overloaded.
* Make sure to specify default settings for all properties.
*/
$this->_set_node(
array(
'id' => $container_id,
@ -447,8 +457,10 @@ class WP_Admin_Bar {
* @param object $root
*/
final protected function _render( $root ) {
// Add browser classes.
// We have to do this here since admin bar shows on the front end.
/*
* Add browser classes.
* We have to do this here since admin bar shows on the front end.
*/
$class = 'nojq nojs';
if ( wp_is_mobile() ) {
$class .= ' mobile';

View File

@ -607,8 +607,11 @@ class WP_Customize_Control {
// Hackily add in the data link parameter.
$dropdown = str_replace( '<select', '<select ' . $this->get_link() . ' id="' . esc_attr( $input_id ) . '" ' . $describedby_attr, $dropdown );
// Even more hacikly add auto-draft page stubs.
// @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>.
/*
* Even more hacikly add auto-draft page stubs.
* @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>.
*/
$nav_menus_created_posts_setting = $this->manager->get_setting( 'nav_menus_created_posts' );
if ( $nav_menus_created_posts_setting && current_user_can( 'publish_pages' ) ) {
$auto_draft_page_options = '';

View File

@ -271,8 +271,10 @@ final class WP_Customize_Manager {
$args['changeset_uuid'] = wp_generate_uuid4();
}
// The theme and messenger_channel should be supplied via $args,
// but they are also looked at in the $_REQUEST global here for back-compat.
/*
* The theme and messenger_channel should be supplied via $args,
* but they are also looked at in the $_REQUEST global here for back-compat.
*/
if ( ! isset( $args['theme'] ) ) {
if ( isset( $_REQUEST['customize_theme'] ) ) {
$args['theme'] = wp_unslash( $_REQUEST['customize_theme'] );
@ -565,8 +567,10 @@ final class WP_Customize_Manager {
// Once the theme is loaded, we'll validate it.
add_action( 'after_setup_theme', array( $this, 'after_setup_theme' ) );
} else {
// If the requested theme is not the active theme and the user doesn't have
// the switch_themes cap, bail.
/*
* If the requested theme is not the active theme and the user doesn't have
* the switch_themes cap, bail.
*/
if ( ! current_user_can( 'switch_themes' ) ) {
$this->wp_die( -1, __( 'Sorry, you are not allowed to edit theme options on this site.' ) );
}
@ -905,8 +909,10 @@ final class WP_Customize_Manager {
*/
public function wp_loaded() {
// Unconditionally register core types for panels, sections, and controls
// in case plugin unhooks all customize_register actions.
/*
* Unconditionally register core types for panels, sections, and controls
* in case plugin unhooks all customize_register actions.
*/
$this->register_panel_type( 'WP_Customize_Panel' );
$this->register_panel_type( 'WP_Customize_Themes_Panel' );
$this->register_section_type( 'WP_Customize_Section' );
@ -5269,8 +5275,7 @@ final class WP_Customize_Manager {
)
);
// Input type: checkbox.
// With custom value.
// Input type: checkbox, with custom value.
$this->add_control(
'display_header_text',
array(
@ -5293,8 +5298,7 @@ final class WP_Customize_Manager {
)
);
// Input type: color.
// With sanitize_callback.
// Input type: color, with sanitize_callback.
$this->add_setting(
'background_color',
array(
@ -5602,8 +5606,10 @@ final class WP_Customize_Manager {
)
);
// If the theme is using the default background callback, we can update
// the background CSS using postMessage.
/*
* If the theme is using the default background callback, we can update
* the background CSS using postMessage.
*/
if ( get_theme_support( 'custom-background', 'wp-head-callback' ) === '_custom_background_cb' ) {
foreach ( array( 'color', 'image', 'preset', 'position_x', 'position_y', 'size', 'repeat', 'attachment' ) as $prop ) {
$this->get_setting( 'background_' . $prop )->transport = 'postMessage';

View File

@ -458,8 +458,10 @@ final class _WP_Editors {
$key = array_search( 'spellchecker', $plugins, true );
if ( false !== $key ) {
// Remove 'spellchecker' from the internal plugins if added with 'tiny_mce_plugins' filter to prevent errors.
// It can be added with 'mce_external_plugins'.
/*
* Remove 'spellchecker' from the internal plugins if added with 'tiny_mce_plugins' filter to prevent errors.
* It can be added with 'mce_external_plugins'.
*/
unset( $plugins[ $key ] );
}

View File

@ -212,8 +212,10 @@ class WP_Embed {
$this->last_attr = $attr;
// KSES converts & into &amp; and we need to undo this.
// See https://core.trac.wordpress.org/ticket/11311
/*
* KSES converts & into &amp; and we need to undo this.
* See https://core.trac.wordpress.org/ticket/11311
*/
$url = str_replace( '&amp;', '&', $url );
// Look for known internal handlers.

View File

@ -324,8 +324,10 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
* @return true|WP_Error
*/
public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = null, $src_abs = false ) {
// If destination width/height isn't specified,
// use same as width/height from source.
/*
* If destination width/height isn't specified,
* use same as width/height from source.
*/
if ( ! $dst_w ) {
$dst_w = $src_w;
}

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.3-beta3-56176';
$wp_version = '6.3-beta3-56177';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.