Skip to content

Commit 792f77b

Browse files
committed
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. git-svn-id: https://develop.svn.wordpress.org/trunk@56176 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 05fd462 commit 792f77b

11 files changed

Lines changed: 84 additions & 42 deletions

File tree

src/wp-admin/includes/ms.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,8 +1005,10 @@ function network_settings_add_js() {
10051005
jQuery( function($) {
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" />' );
10121014
}

src/wp-admin/includes/nav-menu.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,8 +1502,10 @@ function _wp_expand_nav_menu_post_data() {
15021502

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

15091511
$array_bits = array( $matches[1] );

src/wp-admin/includes/options.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,10 @@ function options_general_add_js() {
9090

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" />' );
9799
}

src/wp-admin/includes/plugin-install.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,8 +486,10 @@ function install_plugin_install_status( $api, $loop = false ) {
486486
}
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

493495
$update_file = $api->slug . '/' . $key;

src/wp-admin/includes/plugin.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,10 @@ function _get_plugin_data_markup_translate( $plugin_file, $plugin_data, $markup
178178
'title' => true,
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 );
185187

@@ -969,8 +971,10 @@ function delete_plugins( $plugins, $deprecated = '' ) {
969971

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 );
976980
} else {

src/wp-admin/includes/post.php

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,10 @@ function _wp_translate_postdata( $update = false, $post_data = null ) {
135135

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 )
142144
&& ! current_user_can( $ptype->cap->publish_posts ) )
@@ -1443,8 +1445,10 @@ function get_sample_permalink( $post, $title = null, $name = null ) {
14431445
$post->post_name = sanitize_title( $post->post_name ? $post->post_name : $post->post_title, $post->ID );
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 );
14501454
}
@@ -2073,8 +2077,10 @@ function wp_autosave( $post_data ) {
20732077
// Drafts and auto-drafts are just overwritten by autosave for the same user if the post is not locked.
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
}
20802086
}

src/wp-admin/includes/revision.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@ function wp_get_revision_ui_diff( $post, $compare_from, $compare_to ) {
3939
return false;
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;
4648
}
@@ -118,8 +120,10 @@ function wp_get_revision_ui_diff( $post, $compare_from, $compare_to ) {
118120
$diff = wp_text_diff( $content_from, $content_to, $args );
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

125129
// In split screen mode, show the title before/after side by side.

src/wp-admin/includes/schema.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,8 +548,10 @@ function populate_options( array $options = array() ) {
548548
// 5.6.0
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

555557
// 5.8.0

src/wp-admin/includes/template.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,10 @@ function wp_terms_checklist( $post_id = 0, $args = array() ) {
165165
$output = '';
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 );
172174

@@ -1301,8 +1303,10 @@ function do_meta_boxes( $screen, $context, $data_object ) {
13011303

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

13081312
if ( ! $already_sorted && $sorted ) {

src/wp-admin/includes/update-core.php

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,8 +1229,10 @@ function update_core( $from, $to ) {
12291229
/** This filter is documented in wp-admin/includes/update-core.php */
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();
12361238

@@ -1397,8 +1399,10 @@ function update_core( $from, $to ) {
13971399
}
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

14041408
if ( $available_space && $total_size >= $available_space ) {
@@ -1416,8 +1420,10 @@ function update_core( $from, $to ) {
14161420
}
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 ) ) {
14231429
$lang_dir = WP_LANG_DIR;
@@ -1455,8 +1461,10 @@ function update_core( $from, $to ) {
14551461
// Remove maintenance file, we're done with potential site-breaking changes.
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' )
14621470
&& ! file_exists( WP_CONTENT_DIR . '/themes/twentytwelve/style.css' )

0 commit comments

Comments
 (0)