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. Built from https://develop.svn.wordpress.org/trunk@54855 git-svn-id: http://core.svn.wordpress.org/trunk@54407 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
260276583c
commit
25ea9680ae
|
@ -1557,14 +1557,14 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Show bulk action
|
// Show bulk action.
|
||||||
$( document ).on( 'menu-item-added', function() {
|
$( document ).on( 'menu-item-added', function() {
|
||||||
if ( ! $( '.bulk-actions' ).is( ':visible' ) ) {
|
if ( ! $( '.bulk-actions' ).is( ':visible' ) ) {
|
||||||
$( '.bulk-actions' ).show();
|
$( '.bulk-actions' ).show();
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
// Hide bulk action
|
// Hide bulk action.
|
||||||
$( document ).on( 'menu-removing-item', function( e, el ) {
|
$( document ).on( 'menu-removing-item', function( e, el ) {
|
||||||
var menuElement = $( el ).parents( '#menu-to-edit' );
|
var menuElement = $( el ).parents( '#menu-to-edit' );
|
||||||
if ( menuElement.find( 'li' ).length === 1 && $( '.bulk-actions' ).is( ':visible' ) ) {
|
if ( menuElement.find( 'li' ).length === 1 && $( '.bulk-actions' ).is( ':visible' ) ) {
|
||||||
|
|
|
@ -207,9 +207,10 @@ class WP_List_Util {
|
||||||
* @since 4.7.0
|
* @since 4.7.0
|
||||||
*
|
*
|
||||||
* @param string|array $orderby Optional. Either the field name to order by or an array
|
* @param string|array $orderby Optional. Either the field name to order by or an array
|
||||||
* of multiple orderby fields as $orderby => $order.
|
* of multiple orderby fields as `$orderby => $order`.
|
||||||
* @param string $order Optional. Either 'ASC' or 'DESC'. Only used if $orderby
|
* Default empty array.
|
||||||
* is a string.
|
* @param string $order Optional. Either 'ASC' or 'DESC'. Only used if `$orderby`
|
||||||
|
* is a string. Default 'ASC'.
|
||||||
* @param bool $preserve_keys Optional. Whether to preserve keys. Default false.
|
* @param bool $preserve_keys Optional. Whether to preserve keys. Default false.
|
||||||
* @return array The sorted array.
|
* @return array The sorted array.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -934,7 +934,7 @@ function do_enclose( $content, $post ) {
|
||||||
* @since 4.4.0
|
* @since 4.4.0
|
||||||
*
|
*
|
||||||
* @param string[] $post_links An array of enclosure links.
|
* @param string[] $post_links An array of enclosure links.
|
||||||
* @param int $post_ID Post ID.
|
* @param int $post_id Post ID.
|
||||||
*/
|
*/
|
||||||
$post_links = apply_filters( 'enclosure_links', $post_links, $post->ID );
|
$post_links = apply_filters( 'enclosure_links', $post_links, $post->ID );
|
||||||
|
|
||||||
|
@ -5200,9 +5200,10 @@ function wp_list_pluck( $list, $field, $index_key = null ) {
|
||||||
*
|
*
|
||||||
* @param array $list An array of objects or arrays to sort.
|
* @param array $list An array of objects or arrays to sort.
|
||||||
* @param string|array $orderby Optional. Either the field name to order by or an array
|
* @param string|array $orderby Optional. Either the field name to order by or an array
|
||||||
* of multiple orderby fields as $orderby => $order.
|
* of multiple orderby fields as `$orderby => $order`.
|
||||||
* @param string $order Optional. Either 'ASC' or 'DESC'. Only used if $orderby
|
* Default empty array.
|
||||||
* is a string.
|
* @param string $order Optional. Either 'ASC' or 'DESC'. Only used if `$orderby`
|
||||||
|
* is a string. Default 'ASC'.
|
||||||
* @param bool $preserve_keys Optional. Whether to preserve keys. Default false.
|
* @param bool $preserve_keys Optional. Whether to preserve keys. Default false.
|
||||||
* @return array The sorted array.
|
* @return array The sorted array.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -176,7 +176,7 @@ function determine_locale() {
|
||||||
* *Note:* Don't use translate() directly, use __() or related functions.
|
* *Note:* Don't use translate() directly, use __() or related functions.
|
||||||
*
|
*
|
||||||
* @since 2.2.0
|
* @since 2.2.0
|
||||||
* @since 5.5.0 Introduced gettext-{$domain} filter.
|
* @since 5.5.0 Introduced `gettext-{$domain}` filter.
|
||||||
*
|
*
|
||||||
* @param string $text Text to translate.
|
* @param string $text Text to translate.
|
||||||
* @param string $domain Optional. Text domain. Unique identifier for retrieving translated strings.
|
* @param string $domain Optional. Text domain. Unique identifier for retrieving translated strings.
|
||||||
|
@ -242,7 +242,7 @@ function before_last_bar( $string ) {
|
||||||
* *Note:* Don't use translate_with_gettext_context() directly, use _x() or related functions.
|
* *Note:* Don't use translate_with_gettext_context() directly, use _x() or related functions.
|
||||||
*
|
*
|
||||||
* @since 2.8.0
|
* @since 2.8.0
|
||||||
* @since 5.5.0 Introduced gettext_with_context-{$domain} filter.
|
* @since 5.5.0 Introduced `gettext_with_context-{$domain}` filter.
|
||||||
*
|
*
|
||||||
* @param string $text Text to translate.
|
* @param string $text Text to translate.
|
||||||
* @param string $context Context information for the translators.
|
* @param string $context Context information for the translators.
|
||||||
|
@ -463,7 +463,7 @@ function esc_html_x( $text, $context, $domain = 'default' ) {
|
||||||
* printf( _n( '%s person', '%s people', $count, 'text-domain' ), number_format_i18n( $count ) );
|
* printf( _n( '%s person', '%s people', $count, 'text-domain' ), number_format_i18n( $count ) );
|
||||||
*
|
*
|
||||||
* @since 2.8.0
|
* @since 2.8.0
|
||||||
* @since 5.5.0 Introduced ngettext-{$domain} filter.
|
* @since 5.5.0 Introduced `ngettext-{$domain}` filter.
|
||||||
*
|
*
|
||||||
* @param string $single The text to be used if the number is singular.
|
* @param string $single The text to be used if the number is singular.
|
||||||
* @param string $plural The text to be used if the number is plural.
|
* @param string $plural The text to be used if the number is plural.
|
||||||
|
@ -521,7 +521,7 @@ function _n( $single, $plural, $number, $domain = 'default' ) {
|
||||||
* printf( _nx( '%s group', '%s groups', $animals, 'group of animals', 'text-domain' ), number_format_i18n( $animals ) );
|
* printf( _nx( '%s group', '%s groups', $animals, 'group of animals', 'text-domain' ), number_format_i18n( $animals ) );
|
||||||
*
|
*
|
||||||
* @since 2.8.0
|
* @since 2.8.0
|
||||||
* @since 5.5.0 Introduced ngettext_with_context-{$domain} filter.
|
* @since 5.5.0 Introduced `ngettext_with_context-{$domain}` filter.
|
||||||
*
|
*
|
||||||
* @param string $single The text to be used if the number is singular.
|
* @param string $single The text to be used if the number is singular.
|
||||||
* @param string $plural The text to be used if the number is plural.
|
* @param string $plural The text to be used if the number is plural.
|
||||||
|
@ -1022,9 +1022,9 @@ function load_theme_textdomain( $domain, $path = false ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads the child themes translated strings.
|
* Loads the child theme's translated strings.
|
||||||
*
|
*
|
||||||
* If the current locale exists as a .mo file in the child themes
|
* If the current locale exists as a .mo file in the child theme's
|
||||||
* root directory, it will be included in the translated strings by the $domain.
|
* root directory, it will be included in the translated strings by the $domain.
|
||||||
*
|
*
|
||||||
* The .mo files must be named based on the locale exactly.
|
* The .mo files must be named based on the locale exactly.
|
||||||
|
@ -1361,7 +1361,8 @@ function translate_user_role( $name, $domain = 'default' ) {
|
||||||
*
|
*
|
||||||
* @param string $dir A directory to search for language files.
|
* @param string $dir A directory to search for language files.
|
||||||
* Default WP_LANG_DIR.
|
* Default WP_LANG_DIR.
|
||||||
* @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.
|
* @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.
|
||||||
*/
|
*/
|
||||||
function get_available_languages( $dir = null ) {
|
function get_available_languages( $dir = null ) {
|
||||||
$languages = array();
|
$languages = array();
|
||||||
|
|
|
@ -1325,7 +1325,7 @@ function get_current_network_id() {
|
||||||
* @global WP_Locale $wp_locale WordPress date and time locale object.
|
* @global WP_Locale $wp_locale WordPress date and time locale object.
|
||||||
*/
|
*/
|
||||||
function wp_load_translations_early() {
|
function wp_load_translations_early() {
|
||||||
global $wp_locale, $wp_textdomain_registry;
|
global $wp_textdomain_registry, $wp_locale;
|
||||||
|
|
||||||
static $loaded = false;
|
static $loaded = false;
|
||||||
if ( $loaded ) {
|
if ( $loaded ) {
|
||||||
|
|
|
@ -1547,9 +1547,8 @@ function get_post_types( $args = array(), $output = 'names', $operator = 'and' )
|
||||||
*
|
*
|
||||||
* @global array $wp_post_types List of post types.
|
* @global array $wp_post_types List of post types.
|
||||||
*
|
*
|
||||||
* @param string $post_type Post type key. Must not exceed 20 characters and may
|
* @param string $post_type Post type key. Must not exceed 20 characters and may only contain
|
||||||
* only contain lowercase alphanumeric characters, dashes,
|
* lowercase alphanumeric characters, dashes, and underscores. See sanitize_key().
|
||||||
* and underscores. See sanitize_key().
|
|
||||||
* @param array|string $args {
|
* @param array|string $args {
|
||||||
* Array or string of arguments for registering a post type.
|
* Array or string of arguments for registering a post type.
|
||||||
*
|
*
|
||||||
|
@ -4198,7 +4197,7 @@ function wp_insert_post( $postarr, $wp_error = false, $fire_after_hooks = true )
|
||||||
|
|
||||||
if ( $update && strtolower( urlencode( $post_name ) ) == $check_name && get_post_field( 'post_name', $post_ID ) == $check_name ) {
|
if ( $update && strtolower( urlencode( $post_name ) ) == $check_name && get_post_field( 'post_name', $post_ID ) == $check_name ) {
|
||||||
$post_name = $check_name;
|
$post_name = $check_name;
|
||||||
} else { // new post, or slug has changed.
|
} else { // New post, or slug has changed.
|
||||||
$post_name = sanitize_title( $post_name );
|
$post_name = sanitize_title( $post_name );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -553,7 +553,7 @@ class WP_REST_Server {
|
||||||
* Converts a response to data to send.
|
* Converts a response to data to send.
|
||||||
*
|
*
|
||||||
* @since 4.4.0
|
* @since 4.4.0
|
||||||
* @since 5.4.0 The $embed parameter can now contain a list of link relations to include.
|
* @since 5.4.0 The `$embed` parameter can now contain a list of link relations to include.
|
||||||
*
|
*
|
||||||
* @param WP_REST_Response $response Response object.
|
* @param WP_REST_Response $response Response object.
|
||||||
* @param bool|string[] $embed Whether to embed all links, a filtered list of link relations, or no links.
|
* @param bool|string[] $embed Whether to embed all links, a filtered list of link relations, or no links.
|
||||||
|
@ -677,7 +677,7 @@ class WP_REST_Server {
|
||||||
* Embeds the links from the data into the request.
|
* Embeds the links from the data into the request.
|
||||||
*
|
*
|
||||||
* @since 4.4.0
|
* @since 4.4.0
|
||||||
* @since 5.4.0 The $embed parameter can now contain a list of link relations to include.
|
* @since 5.4.0 The `$embed` parameter can now contain a list of link relations to include.
|
||||||
*
|
*
|
||||||
* @param array $data Data from the request.
|
* @param array $data Data from the request.
|
||||||
* @param bool|string[] $embed Whether to embed all links or a filtered list of link relations.
|
* @param bool|string[] $embed Whether to embed all links or a filtered list of link relations.
|
||||||
|
@ -759,7 +759,7 @@ class WP_REST_Server {
|
||||||
* data instead.
|
* data instead.
|
||||||
*
|
*
|
||||||
* @since 4.4.0
|
* @since 4.4.0
|
||||||
* @since 6.0.0 The $embed parameter can now contain a list of link relations to include
|
* @since 6.0.0 The `$embed` parameter can now contain a list of link relations to include.
|
||||||
*
|
*
|
||||||
* @param WP_REST_Response $response Response object.
|
* @param WP_REST_Response $response Response object.
|
||||||
* @param bool|string[] $embed Whether to embed all links, a filtered list of link relations, or no links.
|
* @param bool|string[] $embed Whether to embed all links, a filtered list of link relations, or no links.
|
||||||
|
|
|
@ -659,11 +659,9 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||||
&& in_array( $prepared_post->post_status, array( 'draft', 'pending' ), true )
|
&& in_array( $prepared_post->post_status, array( 'draft', 'pending' ), true )
|
||||||
) {
|
) {
|
||||||
/*
|
/*
|
||||||
* `wp_unique_post_slug()` returns the same
|
* `wp_unique_post_slug()` returns the same slug for 'draft' or 'pending' posts.
|
||||||
* slug for 'draft' or 'pending' posts.
|
|
||||||
*
|
*
|
||||||
* To ensure that a unique slug is generated,
|
* To ensure that a unique slug is generated, pass the post data with the 'publish' status.
|
||||||
* pass the post data with the 'publish' status.
|
|
||||||
*/
|
*/
|
||||||
$prepared_post->post_name = wp_unique_post_slug(
|
$prepared_post->post_name = wp_unique_post_slug(
|
||||||
$prepared_post->post_name,
|
$prepared_post->post_name,
|
||||||
|
@ -862,15 +860,19 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* `wp_unique_post_slug()` returns the same
|
* `wp_unique_post_slug()` returns the same slug for 'draft' or 'pending' posts.
|
||||||
* slug for 'draft' or 'pending' posts.
|
|
||||||
*
|
*
|
||||||
* To ensure that a unique slug is generated,
|
* To ensure that a unique slug is generated, pass the post data with the 'publish' status.
|
||||||
* pass the post data with the 'publish' status.
|
|
||||||
*/
|
*/
|
||||||
if ( ! empty( $post->post_name ) && in_array( $post_status, array( 'draft', 'pending' ), true ) ) {
|
if ( ! empty( $post->post_name ) && in_array( $post_status, array( 'draft', 'pending' ), true ) ) {
|
||||||
$post_parent = ! empty( $post->post_parent ) ? $post->post_parent : 0;
|
$post_parent = ! empty( $post->post_parent ) ? $post->post_parent : 0;
|
||||||
$post->post_name = wp_unique_post_slug( $post->post_name, $post->ID, 'publish', $post->post_type, $post_parent );
|
$post->post_name = wp_unique_post_slug(
|
||||||
|
$post->post_name,
|
||||||
|
$post->ID,
|
||||||
|
'publish',
|
||||||
|
$post->post_type,
|
||||||
|
$post_parent
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert the post object to an array, otherwise wp_update_post() will expect non-escaped input.
|
// Convert the post object to an array, otherwise wp_update_post() will expect non-escaped input.
|
||||||
|
|
|
@ -221,7 +221,7 @@ class WP_Sitemaps_Posts extends WP_Sitemaps_Provider {
|
||||||
'no_found_rows' => true,
|
'no_found_rows' => true,
|
||||||
'update_post_term_cache' => false,
|
'update_post_term_cache' => false,
|
||||||
'update_post_meta_cache' => false,
|
'update_post_meta_cache' => false,
|
||||||
'ignore_sticky_posts' => true, // sticky posts will still appear, but they won't be moved to the front.
|
'ignore_sticky_posts' => true, // Sticky posts will still appear, but they won't be moved to the front.
|
||||||
),
|
),
|
||||||
$post_type
|
$post_type
|
||||||
);
|
);
|
||||||
|
|
|
@ -390,8 +390,8 @@ function is_taxonomy_hierarchical( $taxonomy ) {
|
||||||
*
|
*
|
||||||
* @global WP_Taxonomy[] $wp_taxonomies Registered taxonomies.
|
* @global WP_Taxonomy[] $wp_taxonomies Registered taxonomies.
|
||||||
*
|
*
|
||||||
* @param string $taxonomy Taxonomy key, must not exceed 32 characters and may only contain lowercase alphanumeric
|
* @param string $taxonomy Taxonomy key. Must not exceed 32 characters and may only contain
|
||||||
* characters, dashes, and underscores. See sanitize_key().
|
* lowercase alphanumeric characters, dashes, and underscores. See sanitize_key().
|
||||||
* @param array|string $object_type Object type or array of object types with which the taxonomy should be associated.
|
* @param array|string $object_type Object type or array of object types with which the taxonomy should be associated.
|
||||||
* @param array|string $args {
|
* @param array|string $args {
|
||||||
* Optional. Array or query string of arguments for registering a taxonomy.
|
* Optional. Array or query string of arguments for registering a taxonomy.
|
||||||
|
|
|
@ -3567,7 +3567,7 @@ function _wp_customize_publish_changeset( $new_status, $old_status, $changeset_p
|
||||||
remove_action( 'customize_register', array( $wp_customize, 'register_controls' ) );
|
remove_action( 'customize_register', array( $wp_customize, 'register_controls' ) );
|
||||||
$wp_customize->register_controls();
|
$wp_customize->register_controls();
|
||||||
|
|
||||||
/** This filter is documented in /wp-includes/class-wp-customize-manager.php */
|
/** This filter is documented in wp-includes/class-wp-customize-manager.php */
|
||||||
do_action( 'customize_register', $wp_customize );
|
do_action( 'customize_register', $wp_customize );
|
||||||
}
|
}
|
||||||
$wp_customize->_publish_changeset_values( $changeset_post->ID );
|
$wp_customize->_publish_changeset_values( $changeset_post->ID );
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.2-alpha-54854';
|
$wp_version = '6.2-alpha-54855';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue