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
This commit is contained in:
John Blackbourn 2020-12-10 23:53:07 +00:00
parent 7e9060a0e4
commit 42fcfa5b3d
8 changed files with 24 additions and 21 deletions

View File

@ -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;

View File

@ -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 = '' ) {

View File

@ -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 );

View File

@ -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 );

View File

@ -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 {

View File

@ -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 <strong>all</strong> 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 ) {

View File

@ -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 ) {

View File

@ -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.