From 42fcfa5b3d12f4e799a2b1e79e6fda71c4945e3d Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Thu, 10 Dec 2020 23:53:07 +0000 Subject: [PATCH] Docs: Various docblock corrections. See #51800 Built from https://develop.svn.wordpress.org/trunk@49789 git-svn-id: http://core.svn.wordpress.org/trunk@49512 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-post-type.php | 2 +- wp-includes/class-wp-query.php | 2 +- wp-includes/class-wp-term.php | 4 ++-- wp-includes/link-template.php | 4 ++-- wp-includes/post.php | 12 ++++++------ wp-includes/taxonomy.php | 16 +++++++++------- wp-includes/user.php | 3 ++- wp-includes/version.php | 2 +- 8 files changed, 24 insertions(+), 21 deletions(-) diff --git a/wp-includes/class-wp-post-type.php b/wp-includes/class-wp-post-type.php index 8b8e427e02..53d45d8a08 100644 --- a/wp-includes/class-wp-post-type.php +++ b/wp-includes/class-wp-post-type.php @@ -123,7 +123,7 @@ final class WP_Post_Type { * Default is the value of $show_ui. * * @since 4.6.0 - * @var bool $show_in_menu + * @var bool|string $show_in_menu */ public $show_in_menu = null; diff --git a/wp-includes/class-wp-query.php b/wp-includes/class-wp-query.php index 076e3749a0..17c6e89895 100644 --- a/wp-includes/class-wp-query.php +++ b/wp-includes/class-wp-query.php @@ -1730,7 +1730,7 @@ class WP_Query { * @since 3.9.0 The `$default` argument was introduced. * * @param string $query_var Query variable key. - * @param mixed $default Optional. Value to return if the query variable is not set. Default empty. + * @param mixed $default Optional. Value to return if the query variable is not set. Default empty string. * @return mixed Contents of the query variable. */ public function get( $query_var, $default = '' ) { diff --git a/wp-includes/class-wp-term.php b/wp-includes/class-wp-term.php index df74705ce2..f79ab8633b 100644 --- a/wp-includes/class-wp-term.php +++ b/wp-includes/class-wp-term.php @@ -44,7 +44,7 @@ final class WP_Term { * The term's term_group. * * @since 4.4.0 - * @var string + * @var int */ public $term_group = ''; @@ -204,7 +204,7 @@ final class WP_Term { * * @since 4.4.0 * - * @param string $filter Filter context. Accepts 'edit', 'db', 'display', 'attribute', 'js', 'raw'. + * @param string $filter Filter context. Accepts 'edit', 'db', 'display', 'attribute', 'js', 'rss', or 'raw'. */ public function filter( $filter ) { sanitize_term( $this, $this->taxonomy, $filter ); diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index b5f400c20c..28e6f98ec7 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -1700,7 +1700,7 @@ function get_next_post( $in_same_term = false, $excluded_terms = '', $taxonomy = * @global wpdb $wpdb WordPress database abstraction object. * * @param bool $in_same_term Optional. Whether post should be in a same taxonomy term. Default false. - * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty. + * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty string. * @param bool $previous Optional. Whether to retrieve previous post. Default true * @param string $taxonomy Optional. Taxonomy, if $in_same_term is true. Default 'category'. * @return null|string|WP_Post Post object if successful. Null if global $post is not set. Empty string if no @@ -1748,7 +1748,7 @@ function get_adjacent_post( $in_same_term = false, $excluded_terms = '', $previo * * @since 4.4.0 * - * @param array $excluded_terms Array of excluded term IDs. + * @param array|string $excluded_terms Array of excluded term IDs. Empty string if none were provided. */ $excluded_terms = apply_filters( "get_{$adjacent}_post_excluded_terms", $excluded_terms ); diff --git a/wp-includes/post.php b/wp-includes/post.php index 4f9c3f8086..87806adfca 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -1393,7 +1393,7 @@ function get_post_types( $args = array(), $output = 'names', $operator = 'and' ) * @type bool $feeds Whether the feed permastruct should be built for this post type. * Default is value of $has_archive. * @type bool $pages Whether the permastruct should provide for pagination. Default true. - * @type const $ep_mask Endpoint mask to assign. If not specified and permalink_epmask is set, + * @type int $ep_mask Endpoint mask to assign. If not specified and permalink_epmask is set, * inherits from $permalink_epmask. If not specified and permalink_epmask * is not set, defaults to EP_PERMALINK. * } @@ -2334,8 +2334,8 @@ function is_sticky( $post_id = 0 ) { * * @param object|WP_Post|array $post The post object or array * @param string $context Optional. How to sanitize post fields. - * Accepts 'raw', 'edit', 'db', or 'display'. - * Default 'display'. + * Accepts 'raw', 'edit', 'db', 'display', + * 'attribute', or 'js'. Default 'display'. * @return object|WP_Post|array The now sanitized post object or array (will be the * same type as `$post`). */ @@ -2507,9 +2507,9 @@ function sanitize_post_field( $field, $value, $post_id, $context = 'display' ) { * * @param mixed $value Value of the prefixed post field. * @param int $post_id Post ID. - * @param string $context Context for how to sanitize the field. Possible - * values include 'edit', 'display', - * 'attribute' and 'js'. + * @param string $context Context for how to sanitize the field. + * Accepts 'raw', 'edit', 'db', 'display', + * 'attribute', or 'js'. Default 'display'. */ $value = apply_filters( "{$field}", $value, $post_id, $context ); } else { diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index c3decccf49..98346ea6ae 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -1509,20 +1509,21 @@ function term_is_ancestor_of( $term1, $term2, $taxonomy ) { } /** - * Sanitize Term all fields. + * Sanitize all term fields. * * Relies on sanitize_term_field() to sanitize the term. The difference is that - * this function will sanitize all fields. The context is based + * this function will sanitize **all** fields. The context is based * on sanitize_term_field(). * - * The $term is expected to be either an array or an object. + * The `$term` is expected to be either an array or an object. * * @since 2.3.0 * * @param array|object $term The term to check. * @param string $taxonomy The taxonomy name to use. - * @param string $context Optional. Context in which to sanitize the term. Accepts 'edit', 'db', - * 'display', 'attribute', or 'js'. Default 'display'. + * @param string $context Optional. Context in which to sanitize the term. + * Accepts 'raw', 'edit', 'db', 'display', 'rss', + * 'attribute', or 'js'. Default 'display'. * @return array|object Term with all fields sanitized. */ function sanitize_term( $term, $taxonomy, $context = 'display' ) { @@ -1572,8 +1573,9 @@ function sanitize_term( $term, $taxonomy, $context = 'display' ) { * @param string $value Search for this term value. * @param int $term_id Term ID. * @param string $taxonomy Taxonomy Name. - * @param string $context Context in which to sanitize the term field. Accepts 'edit', 'db', 'display', - * 'attribute', or 'js'. + * @param string $context Context in which to sanitize the term field. + * Accepts 'raw', 'edit', 'db', 'display', 'rss', + * 'attribute', or 'js'. Default 'display'. * @return mixed Sanitized field. */ function sanitize_term_field( $field, $value, $term_id, $taxonomy, $context ) { diff --git a/wp-includes/user.php b/wp-includes/user.php index 2a2ae2b647..b8275338c8 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -306,7 +306,8 @@ function wp_authenticate_cookie( $user, $username, $password ) { * callback failed authentication. * @param string $username Username for authentication. * @param string $password Password for authentication. - * @return WP_User|WP_Error WP_User on success, WP_Error on failure. + * @return WP_User|WP_Error|null WP_User on success, WP_Error on failure, null if + * null is passed in and this isn't an API request. */ function wp_authenticate_application_password( $input_user, $username, $password ) { if ( $input_user instanceof WP_User ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 331178c4b8..c6b97c9a53 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.7-alpha-49788'; +$wp_version = '5.7-alpha-49789'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.