Skip to content

Commit acbbee8

Browse files
Docs: Update various DocBlocks and inline comments per the documentation standards.
Includes minor formatting edits for consistency. Follow-up to [53/tests], [12179], [12946], [35288], [37884], [38810], [38928], [46596], [48131], [52955], [53548], [53813], [53873], [54118], [54316], [54420], [54421], [54803]. See #56792. git-svn-id: https://develop.svn.wordpress.org/trunk@54855 602fd350-edb4-49c9-b593-d223f7449a82
1 parent a71d737 commit acbbee8

File tree

20 files changed

+99
-92
lines changed

20 files changed

+99
-92
lines changed

src/js/_enqueues/lib/nav-menu.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,14 +1557,14 @@
15571557
});
15581558
});
15591559

1560-
// Show bulk action
1560+
// Show bulk action.
15611561
$( document ).on( 'menu-item-added', function() {
15621562
if ( ! $( '.bulk-actions' ).is( ':visible' ) ) {
15631563
$( '.bulk-actions' ).show();
15641564
}
15651565
} );
15661566

1567-
// Hide bulk action
1567+
// Hide bulk action.
15681568
$( document ).on( 'menu-removing-item', function( e, el ) {
15691569
var menuElement = $( el ).parents( '#menu-to-edit' );
15701570
if ( menuElement.find( 'li' ).length === 1 && $( '.bulk-actions' ).is( ':visible' ) ) {

src/wp-includes/class-wp-list-util.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,10 @@ public function pluck( $field, $index_key = null ) {
207207
* @since 4.7.0
208208
*
209209
* @param string|array $orderby Optional. Either the field name to order by or an array
210-
* of multiple orderby fields as $orderby => $order.
211-
* @param string $order Optional. Either 'ASC' or 'DESC'. Only used if $orderby
212-
* is a string.
210+
* of multiple orderby fields as `$orderby => $order`.
211+
* Default empty array.
212+
* @param string $order Optional. Either 'ASC' or 'DESC'. Only used if `$orderby`
213+
* is a string. Default 'ASC'.
213214
* @param bool $preserve_keys Optional. Whether to preserve keys. Default false.
214215
* @return array The sorted array.
215216
*/

src/wp-includes/compat.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ function mb_strlen( $string, $encoding = null ) {
156156
/**
157157
* Internal compat function to mimic mb_strlen().
158158
*
159-
* Only understands UTF-8 and 8bit. All other character sets will be treated as 8bit.
159+
* Only understands UTF-8 and 8bit. All other character sets will be treated as 8bit.
160160
* For `$encoding === UTF-8`, the `$str` input is expected to be a valid UTF-8 byte
161161
* sequence. The behavior of this function for invalid inputs is undefined.
162162
*

src/wp-includes/functions.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@ function do_enclose( $content, $post ) {
934934
* @since 4.4.0
935935
*
936936
* @param string[] $post_links An array of enclosure links.
937-
* @param int $post_ID Post ID.
937+
* @param int $post_id Post ID.
938938
*/
939939
$post_links = apply_filters( 'enclosure_links', $post_links, $post->ID );
940940

@@ -3330,7 +3330,7 @@ function wp_get_mime_types() {
33303330
* @since 3.5.0
33313331
*
33323332
* @param string[] $wp_get_mime_types Mime types keyed by the file extension regex
3333-
* corresponding to those types.
3333+
* corresponding to those types.
33343334
*/
33353335
return apply_filters(
33363336
'mime_types',
@@ -5200,9 +5200,10 @@ function wp_list_pluck( $list, $field, $index_key = null ) {
52005200
*
52015201
* @param array $list An array of objects or arrays to sort.
52025202
* @param string|array $orderby Optional. Either the field name to order by or an array
5203-
* of multiple orderby fields as $orderby => $order.
5204-
* @param string $order Optional. Either 'ASC' or 'DESC'. Only used if $orderby
5205-
* is a string.
5203+
* of multiple orderby fields as `$orderby => $order`.
5204+
* Default empty array.
5205+
* @param string $order Optional. Either 'ASC' or 'DESC'. Only used if `$orderby`
5206+
* is a string. Default 'ASC'.
52065207
* @param bool $preserve_keys Optional. Whether to preserve keys. Default false.
52075208
* @return array The sorted array.
52085209
*/

src/wp-includes/l10n.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ function determine_locale() {
176176
* *Note:* Don't use translate() directly, use __() or related functions.
177177
*
178178
* @since 2.2.0
179-
* @since 5.5.0 Introduced gettext-{$domain} filter.
179+
* @since 5.5.0 Introduced `gettext-{$domain}` filter.
180180
*
181181
* @param string $text Text to translate.
182182
* @param string $domain Optional. Text domain. Unique identifier for retrieving translated strings.
@@ -242,7 +242,7 @@ function before_last_bar( $string ) {
242242
* *Note:* Don't use translate_with_gettext_context() directly, use _x() or related functions.
243243
*
244244
* @since 2.8.0
245-
* @since 5.5.0 Introduced gettext_with_context-{$domain} filter.
245+
* @since 5.5.0 Introduced `gettext_with_context-{$domain}` filter.
246246
*
247247
* @param string $text Text to translate.
248248
* @param string $context Context information for the translators.
@@ -463,7 +463,7 @@ function esc_html_x( $text, $context, $domain = 'default' ) {
463463
* printf( _n( '%s person', '%s people', $count, 'text-domain' ), number_format_i18n( $count ) );
464464
*
465465
* @since 2.8.0
466-
* @since 5.5.0 Introduced ngettext-{$domain} filter.
466+
* @since 5.5.0 Introduced `ngettext-{$domain}` filter.
467467
*
468468
* @param string $single The text to be used if the number is singular.
469469
* @param string $plural The text to be used if the number is plural.
@@ -521,7 +521,7 @@ function _n( $single, $plural, $number, $domain = 'default' ) {
521521
* printf( _nx( '%s group', '%s groups', $animals, 'group of animals', 'text-domain' ), number_format_i18n( $animals ) );
522522
*
523523
* @since 2.8.0
524-
* @since 5.5.0 Introduced ngettext_with_context-{$domain} filter.
524+
* @since 5.5.0 Introduced `ngettext_with_context-{$domain}` filter.
525525
*
526526
* @param string $single The text to be used if the number is singular.
527527
* @param string $plural The text to be used if the number is plural.
@@ -1022,9 +1022,9 @@ function load_theme_textdomain( $domain, $path = false ) {
10221022
}
10231023

10241024
/**
1025-
* Loads the child themes translated strings.
1025+
* Loads the child theme's translated strings.
10261026
*
1027-
* If the current locale exists as a .mo file in the child themes
1027+
* If the current locale exists as a .mo file in the child theme's
10281028
* root directory, it will be included in the translated strings by the $domain.
10291029
*
10301030
* The .mo files must be named based on the locale exactly.
@@ -1361,7 +1361,8 @@ function translate_user_role( $name, $domain = 'default' ) {
13611361
*
13621362
* @param string $dir A directory to search for language files.
13631363
* Default WP_LANG_DIR.
1364-
* @return string[] An array of language codes or an empty array if no languages are present. Language codes are formed by stripping the .mo extension from the language file names.
1364+
* @return string[] An array of language codes or an empty array if no languages are present.
1365+
* Language codes are formed by stripping the .mo extension from the language file names.
13651366
*/
13661367
function get_available_languages( $dir = null ) {
13671368
$languages = array();

src/wp-includes/load.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1322,10 +1322,10 @@ function get_current_network_id() {
13221322
* @access private
13231323
*
13241324
* @global WP_Textdomain_Registry $wp_textdomain_registry WordPress Textdomain Registry.
1325-
* @global WP_Locale $wp_locale WordPress date and time locale object.
1325+
* @global WP_Locale $wp_locale WordPress date and time locale object.
13261326
*/
13271327
function wp_load_translations_early() {
1328-
global $wp_locale, $wp_textdomain_registry;
1328+
global $wp_textdomain_registry, $wp_locale;
13291329

13301330
static $loaded = false;
13311331
if ( $loaded ) {

src/wp-includes/post.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1547,9 +1547,8 @@ function get_post_types( $args = array(), $output = 'names', $operator = 'and' )
15471547
*
15481548
* @global array $wp_post_types List of post types.
15491549
*
1550-
* @param string $post_type Post type key. Must not exceed 20 characters and may
1551-
* only contain lowercase alphanumeric characters, dashes,
1552-
* and underscores. See sanitize_key().
1550+
* @param string $post_type Post type key. Must not exceed 20 characters and may only contain
1551+
* lowercase alphanumeric characters, dashes, and underscores. See sanitize_key().
15531552
* @param array|string $args {
15541553
* Array or string of arguments for registering a post type.
15551554
*
@@ -4198,7 +4197,7 @@ function wp_insert_post( $postarr, $wp_error = false, $fire_after_hooks = true )
41984197

41994198
if ( $update && strtolower( urlencode( $post_name ) ) == $check_name && get_post_field( 'post_name', $post_ID ) == $check_name ) {
42004199
$post_name = $check_name;
4201-
} else { // new post, or slug has changed.
4200+
} else { // New post, or slug has changed.
42024201
$post_name = sanitize_title( $post_name );
42034202
}
42044203
}

src/wp-includes/rest-api/class-wp-rest-server.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ public function serve_request( $path = null ) {
553553
* Converts a response to data to send.
554554
*
555555
* @since 4.4.0
556-
* @since 5.4.0 The $embed parameter can now contain a list of link relations to include.
556+
* @since 5.4.0 The `$embed` parameter can now contain a list of link relations to include.
557557
*
558558
* @param WP_REST_Response $response Response object.
559559
* @param bool|string[] $embed Whether to embed all links, a filtered list of link relations, or no links.
@@ -677,7 +677,7 @@ public static function get_compact_response_links( $response ) {
677677
* Embeds the links from the data into the request.
678678
*
679679
* @since 4.4.0
680-
* @since 5.4.0 The $embed parameter can now contain a list of link relations to include.
680+
* @since 5.4.0 The `$embed` parameter can now contain a list of link relations to include.
681681
*
682682
* @param array $data Data from the request.
683683
* @param bool|string[] $embed Whether to embed all links or a filtered list of link relations.
@@ -759,7 +759,7 @@ protected function embed_links( $data, $embed = true ) {
759759
* data instead.
760760
*
761761
* @since 4.4.0
762-
* @since 6.0.0 The $embed parameter can now contain a list of link relations to include
762+
* @since 6.0.0 The `$embed` parameter can now contain a list of link relations to include.
763763
*
764764
* @param WP_REST_Response $response Response object.
765765
* @param bool|string[] $embed Whether to embed all links, a filtered list of link relations, or no links.

src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -659,11 +659,9 @@ public function create_item( $request ) {
659659
&& in_array( $prepared_post->post_status, array( 'draft', 'pending' ), true )
660660
) {
661661
/*
662-
* `wp_unique_post_slug()` returns the same
663-
* slug for 'draft' or 'pending' posts.
662+
* `wp_unique_post_slug()` returns the same slug for 'draft' or 'pending' posts.
664663
*
665-
* To ensure that a unique slug is generated,
666-
* pass the post data with the 'publish' status.
664+
* To ensure that a unique slug is generated, pass the post data with the 'publish' status.
667665
*/
668666
$prepared_post->post_name = wp_unique_post_slug(
669667
$prepared_post->post_name,
@@ -862,15 +860,19 @@ public function update_item( $request ) {
862860
}
863861

864862
/*
865-
* `wp_unique_post_slug()` returns the same
866-
* slug for 'draft' or 'pending' posts.
863+
* `wp_unique_post_slug()` returns the same slug for 'draft' or 'pending' posts.
867864
*
868-
* To ensure that a unique slug is generated,
869-
* pass the post data with the 'publish' status.
865+
* To ensure that a unique slug is generated, pass the post data with the 'publish' status.
870866
*/
871867
if ( ! empty( $post->post_name ) && in_array( $post_status, array( 'draft', 'pending' ), true ) ) {
872868
$post_parent = ! empty( $post->post_parent ) ? $post->post_parent : 0;
873-
$post->post_name = wp_unique_post_slug( $post->post_name, $post->ID, 'publish', $post->post_type, $post_parent );
869+
$post->post_name = wp_unique_post_slug(
870+
$post->post_name,
871+
$post->ID,
872+
'publish',
873+
$post->post_type,
874+
$post_parent
875+
);
874876
}
875877

876878
// Convert the post object to an array, otherwise wp_update_post() will expect non-escaped input.

src/wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ protected function get_posts_query_args( $post_type ) {
221221
'no_found_rows' => true,
222222
'update_post_term_cache' => false,
223223
'update_post_meta_cache' => false,
224-
'ignore_sticky_posts' => true, // sticky posts will still appear, but they won't be moved to the front.
224+
'ignore_sticky_posts' => true, // Sticky posts will still appear, but they won't be moved to the front.
225225
),
226226
$post_type
227227
);

0 commit comments

Comments
 (0)