diff options
Diffstat (limited to 'src/wp-includes')
-rw-r--r-- | src/wp-includes/class-wp-image-editor-imagick.php | 51 | ||||
-rw-r--r-- | src/wp-includes/class-wpdb.php | 8 | ||||
-rw-r--r-- | src/wp-includes/comment-template.php | 4 | ||||
-rw-r--r-- | src/wp-includes/comment.php | 6 | ||||
-rw-r--r-- | src/wp-includes/css/wp-embed-template.css | 17 | ||||
-rw-r--r-- | src/wp-includes/formatting.php | 9 | ||||
-rw-r--r-- | src/wp-includes/link-template.php | 31 | ||||
-rw-r--r-- | src/wp-includes/media-template.php | 4 | ||||
-rw-r--r-- | src/wp-includes/meta.php | 188 | ||||
-rw-r--r-- | src/wp-includes/ms-load.php | 8 | ||||
-rw-r--r-- | src/wp-includes/ms-site.php | 8 | ||||
-rw-r--r-- | src/wp-includes/pluggable.php | 2 | ||||
-rw-r--r-- | src/wp-includes/plugin.php | 4 | ||||
-rw-r--r-- | src/wp-includes/post.php | 6 | ||||
-rw-r--r-- | src/wp-includes/rest-api/class-wp-rest-response.php | 4 | ||||
-rw-r--r-- | src/wp-includes/rest-api/endpoints/class-wp-rest-controller.php | 8 | ||||
-rw-r--r-- | src/wp-includes/taxonomy.php | 14 | ||||
-rw-r--r-- | src/wp-includes/theme.php | 2 | ||||
-rw-r--r-- | src/wp-includes/user.php | 6 |
19 files changed, 231 insertions, 149 deletions
diff --git a/src/wp-includes/class-wp-image-editor-imagick.php b/src/wp-includes/class-wp-image-editor-imagick.php index 66085ac503..2e7c7039d5 100644 --- a/src/wp-includes/class-wp-image-editor-imagick.php +++ b/src/wp-includes/class-wp-image-editor-imagick.php @@ -484,37 +484,28 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor { $this->image->setOption( 'png:compression-filter', '5' ); $this->image->setOption( 'png:compression-level', '9' ); $this->image->setOption( 'png:compression-strategy', '1' ); - // Check to see if a PNG is indexed, and find the pixel depth. - if ( is_callable( array( $this->image, 'getImageDepth' ) ) ) { - $indexed_pixel_depth = $this->image->getImageDepth(); - - // Indexed PNG files get some additional handling. - if ( 0 < $indexed_pixel_depth && 8 >= $indexed_pixel_depth ) { - // Check for an alpha channel. - if ( - is_callable( array( $this->image, 'getImageAlphaChannel' ) ) - && $this->image->getImageAlphaChannel() - ) { - $this->image->setOption( 'png:include-chunk', 'tRNS' ); - } else { - $this->image->setOption( 'png:exclude-chunk', 'all' ); - } - - // Reduce colors in the images to maximum needed, using the global colorspace. - $max_colors = pow( 2, $indexed_pixel_depth ); - if ( is_callable( array( $this->image, 'getImageColors' ) ) ) { - $current_colors = $this->image->getImageColors(); - $max_colors = min( $max_colors, $current_colors ); - } - $this->image->quantizeImage( $max_colors, $this->image->getColorspace(), 0, false, false ); - - /** - * If the colorspace is 'gray', use the png8 format to ensure it stays indexed. - */ - if ( Imagick::COLORSPACE_GRAY === $this->image->getImageColorspace() ) { - $this->image->setOption( 'png:format', 'png8' ); - } + + // Indexed PNG files get some additional handling. + // See #63448 for details. + if ( + is_callable( array( $this->image, 'getImageProperty' ) ) + && '3' === $this->image->getImageProperty( 'png:IHDR.color-type-orig' ) + ) { + + // Check for an alpha channel. + if ( + is_callable( array( $this->image, 'getImageAlphaChannel' ) ) + && $this->image->getImageAlphaChannel() + ) { + $this->image->setOption( 'png:include-chunk', 'tRNS' ); + } else { + $this->image->setOption( 'png:exclude-chunk', 'all' ); } + // Set the image format to Indexed PNG. + $this->image->setOption( 'png:format', 'png8' ); + + } else { + $this->image->setOption( 'png:exclude-chunk', 'all' ); } } diff --git a/src/wp-includes/class-wpdb.php b/src/wp-includes/class-wpdb.php index c6e6099c26..47f291fcb3 100644 --- a/src/wp-includes/class-wpdb.php +++ b/src/wp-includes/class-wpdb.php @@ -2866,8 +2866,12 @@ class wpdb { * @return array { * Array of values and formats keyed by their field names. * - * @type mixed $value The value to be formatted. - * @type string $format The format to be mapped to the value. + * @type array ...$0 { + * Value and format for this field. + * + * @type mixed $value The value to be formatted. + * @type string $format The format to be mapped to the value. + * } * } */ protected function process_field_formats( $data, $format ) { diff --git a/src/wp-includes/comment-template.php b/src/wp-includes/comment-template.php index 9190cf6eff..cd41d4b200 100644 --- a/src/wp-includes/comment-template.php +++ b/src/wp-includes/comment-template.php @@ -2095,8 +2095,8 @@ function comment_id_fields( $post = null ) { * * Only affects users with JavaScript disabled. * - * @internal The $comment global must be present to allow template tags access to the current - * comment. See https://core.trac.wordpress.org/changeset/36512. + * {@internal The $comment global must be present to allow template tags access to the current + * comment. See https://core.trac.wordpress.org/changeset/36512.} * * @since 2.7.0 * @since 6.2.0 Added the `$post` parameter. diff --git a/src/wp-includes/comment.php b/src/wp-includes/comment.php index d0a7743c0e..3909683bce 100644 --- a/src/wp-includes/comment.php +++ b/src/wp-includes/comment.php @@ -446,6 +446,8 @@ function get_comment_count( $post_id = 0 ) { /** * Adds meta data field to a comment. * + * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input. + * * @since 2.9.0 * * @link https://developer.wordpress.org/reference/functions/add_comment_meta/ @@ -474,6 +476,8 @@ function add_comment_meta( $comment_id, $meta_key, $meta_value, $unique = false * value, will keep from removing duplicate metadata with the same key. It also * allows removing all metadata matching key, if needed. * + * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input. + * * @since 2.9.0 * * @link https://developer.wordpress.org/reference/functions/delete_comment_meta/ @@ -540,6 +544,8 @@ function wp_lazyload_comment_meta( array $comment_ids ) { * * If the meta field for the comment does not exist, it will be added. * + * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input. + * * @since 2.9.0 * * @link https://developer.wordpress.org/reference/functions/update_comment_meta/ diff --git a/src/wp-includes/css/wp-embed-template.css b/src/wp-includes/css/wp-embed-template.css index b5a482b737..7b86fdd3d3 100644 --- a/src/wp-includes/css/wp-embed-template.css +++ b/src/wp-includes/css/wp-embed-template.css @@ -39,15 +39,15 @@ body { } .dashicons-admin-comments { - background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M5%202h9q.82%200%201.41.59T16%204v7q0%20.82-.59%201.41T14%2013h-2l-5%205v-5H5q-.82%200-1.41-.59T3%2011V4q0-.82.59-1.41T5%202z%27%20fill%3D%27%2382878c%27%2F%3E%3C%2Fsvg%3E"); + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M5%202h9q.82%200%201.41.59T16%204v7q0%20.82-.59%201.41T14%2013h-2l-5%205v-5H5q-.82%200-1.41-.59T3%2011V4q0-.82.59-1.41T5%202z%27%20fill%3D%27%23646970%27%2F%3E%3C%2Fsvg%3E"); } .wp-embed-comments a:hover .dashicons-admin-comments { - background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M5%202h9q.82%200%201.41.59T16%204v7q0%20.82-.59%201.41T14%2013h-2l-5%205v-5H5q-.82%200-1.41-.59T3%2011V4q0-.82.59-1.41T5%202z%27%20fill%3D%27%230073aa%27%2F%3E%3C%2Fsvg%3E"); + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M5%202h9q.82%200%201.41.59T16%204v7q0%20.82-.59%201.41T14%2013h-2l-5%205v-5H5q-.82%200-1.41-.59T3%2011V4q0-.82.59-1.41T5%202z%27%20fill%3D%27%23135e96%27%2F%3E%3C%2Fsvg%3E"); } .dashicons-share { - background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M14.5%2012q1.24%200%202.12.88T17.5%2015t-.88%202.12-2.12.88-2.12-.88T11.5%2015q0-.34.09-.69l-4.38-2.3Q6.32%2013%205%2013q-1.24%200-2.12-.88T2%2010t.88-2.12T5%207q1.3%200%202.21.99l4.38-2.3q-.09-.35-.09-.69%200-1.24.88-2.12T14.5%202t2.12.88T17.5%205t-.88%202.12T14.5%208q-1.3%200-2.21-.99l-4.38%202.3Q8%209.66%208%2010t-.09.69l4.38%202.3q.89-.99%202.21-.99z%27%20fill%3D%27%2382878c%27%2F%3E%3C%2Fsvg%3E"); + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M14.5%2012q1.24%200%202.12.88T17.5%2015t-.88%202.12-2.12.88-2.12-.88T11.5%2015q0-.34.09-.69l-4.38-2.3Q6.32%2013%205%2013q-1.24%200-2.12-.88T2%2010t.88-2.12T5%207q1.3%200%202.21.99l4.38-2.3q-.09-.35-.09-.69%200-1.24.88-2.12T14.5%202t2.12.88T17.5%205t-.88%202.12T14.5%208q-1.3%200-2.21-.99l-4.38%202.3Q8%209.66%208%2010t-.09.69l4.38%202.3q.89-.99%202.21-.99z%27%20fill%3D%27%23646970%27%2F%3E%3C%2Fsvg%3E"); display: none; } @@ -56,7 +56,7 @@ body { } .wp-embed-share-dialog-open:hover .dashicons-share { - background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M14.5%2012q1.24%200%202.12.88T17.5%2015t-.88%202.12-2.12.88-2.12-.88T11.5%2015q0-.34.09-.69l-4.38-2.3Q6.32%2013%205%2013q-1.24%200-2.12-.88T2%2010t.88-2.12T5%207q1.3%200%202.21.99l4.38-2.3q-.09-.35-.09-.69%200-1.24.88-2.12T14.5%202t2.12.88T17.5%205t-.88%202.12T14.5%208q-1.3%200-2.21-.99l-4.38%202.3Q8%209.66%208%2010t-.09.69l4.38%202.3q.89-.99%202.21-.99z%27%20fill%3D%27%230073aa%27%2F%3E%3C%2Fsvg%3E"); + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M14.5%2012q1.24%200%202.12.88T17.5%2015t-.88%202.12-2.12.88-2.12-.88T11.5%2015q0-.34.09-.69l-4.38-2.3Q6.32%2013%205%2013q-1.24%200-2.12-.88T2%2010t.88-2.12T5%207q1.3%200%202.21.99l4.38-2.3q-.09-.35-.09-.69%200-1.24.88-2.12T14.5%202t2.12.88T17.5%205t-.88%202.12T14.5%208q-1.3%200-2.21-.99l-4.38%202.3Q8%209.66%208%2010t-.09.69l4.38%202.3q.89-.99%202.21-.99z%27%20fill%3D%27%23135e96%27%2F%3E%3C%2Fsvg%3E"); } .wp-embed { @@ -65,7 +65,7 @@ body { font-weight: 400; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; line-height: 1.5; - color: #8c8f94; + color: #646970; background: #fff; border: 1px solid #dcdcde; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); @@ -75,7 +75,7 @@ body { } .wp-embed a { - color: #8c8f94; + color: #646970; text-decoration: none; } @@ -115,7 +115,8 @@ p.wp-embed-heading { } .wp-embed .wp-embed-more { - color: #c3c4c7; + color: #2271b1; + text-decoration: underline; } .wp-embed-footer { @@ -163,7 +164,7 @@ p.wp-embed-heading { .wp-embed-meta a:hover { text-decoration: none; - color: #2271b1; + color: #135e96; } .wp-embed-comments a { diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php index 744eefeb82..4033571edf 100644 --- a/src/wp-includes/formatting.php +++ b/src/wp-includes/formatting.php @@ -2551,6 +2551,11 @@ function balanceTags( $text, $force = false ) { // phpcs:ignore WordPress.Namin /** * Balances tags of string using a modified stack. * + * {@internal Modified by Scott Reilly (coffee2code) 02 Aug 2004 + * 1.1 Fixed handling of append/stack pop order of end text + * Added Cleaning Hooks + * 1.0 First Version} + * * @since 2.0.4 * @since 5.3.0 Improve accuracy and add support for custom element tags. * @@ -2559,10 +2564,6 @@ function balanceTags( $text, $force = false ) { // phpcs:ignore WordPress.Namin * @copyright November 4, 2001 * @version 1.1 * @todo Make better - change loop condition to $text in 1.2 - * @internal Modified by Scott Reilly (coffee2code) 02 Aug 2004 - * 1.1 Fixed handling of append/stack pop order of end text - * Added Cleaning Hooks - * 1.0 First Version * * @param string $text Text to be balanced. * @return string Balanced text. diff --git a/src/wp-includes/link-template.php b/src/wp-includes/link-template.php index 3e02c17853..cf41630c4a 100644 --- a/src/wp-includes/link-template.php +++ b/src/wp-includes/link-template.php @@ -4298,6 +4298,8 @@ function the_shortlink( $text = '', $title = '', $before = '', $after = '' ) { * - 'monsterid' (a monster) * - 'wavatar' (a cartoon face) * - 'identicon' (the "quilt", a geometric pattern) + * - 'initials' (initials based avatar with background color) + * - 'color' (generated background color) * - 'mystery', 'mm', or 'mysteryman' (The Oyster Man) * - 'blank' (transparent GIF) * - 'gravatar_default' (the Gravatar logo) @@ -4366,6 +4368,8 @@ function is_avatar_comment_type( $comment_type ) { * - 'monsterid' (a monster) * - 'wavatar' (a cartoon face) * - 'identicon' (the "quilt", a geometric pattern) + * - 'initials' (initials based avatar with background color) + * - 'color' (generated background color) * - 'mystery', 'mm', or 'mysteryman' (The Oyster Man) * - 'blank' (transparent GIF) * - 'gravatar_default' (the Gravatar logo) @@ -4545,6 +4549,33 @@ function get_avatar_data( $id_or_email, $args = null ) { 'r' => $args['rating'], ); + // Handle additional parameters for the 'initials' avatar type + if ( 'initials' === $args['default'] ) { + $name = ''; + + if ( $user ) { + $name = ! empty( $user->display_name ) ? $user->display_name : + ( ! empty( $user->first_name ) && ! empty( $user->last_name ) ? + $user->first_name . ' ' . $user->last_name : $user->user_login ); + } elseif ( is_object( $id_or_email ) && isset( $id_or_email->comment_author ) ) { + $name = $id_or_email->comment_author; + } elseif ( is_string( $id_or_email ) && false !== strpos( $id_or_email, '@' ) ) { + $name = str_replace( array( '.', '_', '-' ), ' ', substr( $id_or_email, 0, strpos( $id_or_email, '@' ) ) ); + } + + if ( ! empty( $name ) ) { + if ( preg_match( '/\p{Han}|\p{Hiragana}|\p{Katakana}|\p{Hangul}/u', $name ) || false === strpos( $name, ' ' ) ) { + $initials = mb_substr( $name, 0, min( 2, mb_strlen( $name, 'UTF-8' ) ), 'UTF-8' ); + } else { + $first = mb_substr( $name, 0, 1, 'UTF-8' ); + $last = mb_substr( $name, strrpos( $name, ' ' ) + 1, 1, 'UTF-8' ); + $initials = $first . $last; + } + + $url_args['initials'] = $initials; + } + } + /* * Gravatars are always served over HTTPS. * diff --git a/src/wp-includes/media-template.php b/src/wp-includes/media-template.php index 86fe200f8d..4e7592bd74 100644 --- a/src/wp-includes/media-template.php +++ b/src/wp-includes/media-template.php @@ -443,7 +443,7 @@ function wp_print_media_templates() { ?> </h2> <div class="uploaded"><strong><?php _e( 'Uploaded on:' ); ?></strong> {{ data.dateFormatted }}</div> - <div class="uploaded-by"> + <div class="uploaded-by word-wrap-break-word"> <strong><?php _e( 'Uploaded by:' ); ?></strong> <# if ( data.authorLink ) { #> <a href="{{ data.authorLink }}">{{ data.authorName }}</a> @@ -605,7 +605,7 @@ function wp_print_media_templates() { <div class="centered"> <# if ( data.image && data.image.src && data.image.src !== data.icon ) { #> <img src="{{ data.image.src }}" class="thumbnail" draggable="false" alt="" /> - <# } else if ( data.sizes ) { + <# } else if ( data.sizes ) { if ( data.sizes.medium ) { #> <img src="{{ data.sizes.medium.url }}" class="thumbnail" draggable="false" alt="" /> <# } else { #> diff --git a/src/wp-includes/meta.php b/src/wp-includes/meta.php index 6982e618c3..d60bf5e875 100644 --- a/src/wp-includes/meta.php +++ b/src/wp-includes/meta.php @@ -15,12 +15,14 @@ require ABSPATH . WPINC . '/class-wp-metadata-lazyloader.php'; /** * Adds metadata for the specified object. * + * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input. + * * @since 2.9.0 * * @global wpdb $wpdb WordPress database abstraction object. * - * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param int $object_id ID of the object metadata is for. * @param string $meta_key Metadata key. * @param mixed $meta_value Metadata value. Arrays and objects are stored as serialized data and @@ -65,11 +67,12 @@ function add_metadata( $meta_type, $object_id, $meta_key, $meta_value, $unique = * Short-circuits adding metadata of a specific type. * * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type - * (post, comment, term, user, or any other type with an associated meta table). + * (blog, post, comment, term, user, or any other type with an associated meta table). * Returning a non-null value will effectively short-circuit the function. * * Possible hook names include: * + * - `add_blog_metadata` * - `add_post_metadata` * - `add_comment_metadata` * - `add_term_metadata` @@ -77,11 +80,12 @@ function add_metadata( $meta_type, $object_id, $meta_key, $meta_value, $unique = * * @since 3.1.0 * - * @param null|bool $check Whether to allow adding metadata for the given type. - * @param int $object_id ID of the object metadata is for. - * @param string $meta_key Metadata key. - * @param mixed $meta_value Metadata value. Must be serializable if non-scalar. - * @param bool $unique Whether the specified meta key should be unique for the object. + * @param null|int|false $check Whether to allow adding metadata for the given type. Return false or a meta ID + * to short-circuit the function. Return null to continue with the default behavior. + * @param int $object_id ID of the object metadata is for. + * @param string $meta_key Metadata key. + * @param mixed $meta_value Metadata value. Must be serializable if non-scalar. + * @param bool $unique Whether the specified meta key should be unique for the object. */ $check = apply_filters( "add_{$meta_type}_metadata", null, $object_id, $meta_key, $meta_value, $unique ); if ( null !== $check ) { @@ -105,10 +109,11 @@ function add_metadata( $meta_type, $object_id, $meta_key, $meta_value, $unique = * Fires immediately before meta of a specific type is added. * * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type - * (post, comment, term, user, or any other type with an associated meta table). + * (blog, post, comment, term, user, or any other type with an associated meta table). * * Possible hook names include: * + * - `add_blog_meta` * - `add_post_meta` * - `add_comment_meta` * - `add_term_meta` @@ -143,10 +148,11 @@ function add_metadata( $meta_type, $object_id, $meta_key, $meta_value, $unique = * Fires immediately after meta of a specific type is added. * * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type - * (post, comment, term, user, or any other type with an associated meta table). + * (blog, post, comment, term, user, or any other type with an associated meta table). * * Possible hook names include: * + * - `added_blog_meta` * - `added_post_meta` * - `added_comment_meta` * - `added_term_meta` @@ -168,12 +174,14 @@ function add_metadata( $meta_type, $object_id, $meta_key, $meta_value, $unique = * Updates metadata for the specified object. If no value already exists for the specified object * ID and metadata key, the metadata will be added. * + * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input. + * * @since 2.9.0 * * @global wpdb $wpdb WordPress database abstraction object. * - * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param int $object_id ID of the object metadata is for. * @param string $meta_key Metadata key. * @param mixed $meta_value Metadata value. Must be serializable if non-scalar. @@ -218,11 +226,12 @@ function update_metadata( $meta_type, $object_id, $meta_key, $meta_value, $prev_ * Short-circuits updating metadata of a specific type. * * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type - * (post, comment, term, user, or any other type with an associated meta table). + * (blog, post, comment, term, user, or any other type with an associated meta table). * Returning a non-null value will effectively short-circuit the function. * * Possible hook names include: * + * - `update_blog_metadata` * - `update_post_metadata` * - `update_comment_metadata` * - `update_term_metadata` @@ -277,10 +286,11 @@ function update_metadata( $meta_type, $object_id, $meta_key, $meta_value, $prev_ * Fires immediately before updating metadata of a specific type. * * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type - * (post, comment, term, user, or any other type with an associated meta table). + * (blog, post, comment, term, user, or any other type with an associated meta table). * * Possible hook names include: * + * - `update_blog_meta` * - `update_post_meta` * - `update_comment_meta` * - `update_term_meta` @@ -323,10 +333,11 @@ function update_metadata( $meta_type, $object_id, $meta_key, $meta_value, $prev_ * Fires immediately after updating metadata of a specific type. * * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type - * (post, comment, term, user, or any other type with an associated meta table). + * (blog, post, comment, term, user, or any other type with an associated meta table). * * Possible hook names include: * + * - `updated_blog_meta` * - `updated_post_meta` * - `updated_comment_meta` * - `updated_term_meta` @@ -363,12 +374,14 @@ function update_metadata( $meta_type, $object_id, $meta_key, $meta_value, $prev_ /** * Deletes metadata for the specified object. * + * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input. + * * @since 2.9.0 * * @global wpdb $wpdb WordPress database abstraction object. * - * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param int $object_id ID of the object metadata is for. * @param string $meta_key Metadata key. * @param mixed $meta_value Optional. Metadata value. Must be serializable if non-scalar. @@ -411,11 +424,12 @@ function delete_metadata( $meta_type, $object_id, $meta_key, $meta_value = '', $ * Short-circuits deleting metadata of a specific type. * * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type - * (post, comment, term, user, or any other type with an associated meta table). + * (blog, post, comment, term, user, or any other type with an associated meta table). * Returning a non-null value will effectively short-circuit the function. * * Possible hook names include: * + * - `delete_blog_metadata` * - `delete_post_metadata` * - `delete_comment_metadata` * - `delete_term_metadata` @@ -466,10 +480,11 @@ function delete_metadata( $meta_type, $object_id, $meta_key, $meta_value = '', $ * Fires immediately before deleting metadata of a specific type. * * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type - * (post, comment, term, user, or any other type with an associated meta table). + * (blog, post, comment, term, user, or any other type with an associated meta table). * * Possible hook names include: * + * - `delete_blog_meta` * - `delete_post_meta` * - `delete_comment_meta` * - `delete_term_meta` @@ -515,10 +530,11 @@ function delete_metadata( $meta_type, $object_id, $meta_key, $meta_value = '', $ * Fires immediately after deleting metadata of a specific type. * * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type - * (post, comment, term, user, or any other type with an associated meta table). + * (blog, post, comment, term, user, or any other type with an associated meta table). * * Possible hook names include: * + * - `deleted_blog_meta` * - `deleted_post_meta` * - `deleted_comment_meta` * - `deleted_term_meta` @@ -563,8 +579,8 @@ function delete_metadata( $meta_type, $object_id, $meta_key, $meta_value = '', $ * @see get_metadata_raw() * @see get_metadata_default() * - * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param int $object_id ID of the object metadata is for. * @param string $meta_key Optional. Metadata key. If not specified, retrieve all metadata for * the specified object. Default empty string. @@ -596,8 +612,8 @@ function get_metadata( $meta_type, $object_id, $meta_key = '', $single = false ) * * @since 5.5.0 * - * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param int $object_id ID of the object metadata is for. * @param string $meta_key Optional. Metadata key. If not specified, retrieve all metadata for * the specified object. Default empty string. @@ -623,11 +639,12 @@ function get_metadata_raw( $meta_type, $object_id, $meta_key = '', $single = fal * Short-circuits the return value of a meta field. * * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type - * (post, comment, term, user, or any other type with an associated meta table). + * (blog, post, comment, term, user, or any other type with an associated meta table). * Returning a non-null value will effectively short-circuit the function. * * Possible filter names include: * + * - `get_blog_metadata` * - `get_post_metadata` * - `get_comment_metadata` * - `get_term_metadata` @@ -641,8 +658,8 @@ function get_metadata_raw( $meta_type, $object_id, $meta_key = '', $single = fal * @param int $object_id ID of the object metadata is for. * @param string $meta_key Metadata key. * @param bool $single Whether to return only the first value of the specified `$meta_key`. - * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. */ $check = apply_filters( "get_{$meta_type}_metadata", null, $object_id, $meta_key, $single, $meta_type ); if ( null !== $check ) { @@ -687,8 +704,8 @@ function get_metadata_raw( $meta_type, $object_id, $meta_key = '', $single = fal * * @since 5.5.0 * - * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param int $object_id ID of the object metadata is for. * @param string $meta_key Metadata key. * @param bool $single Optional. If true, return only the first value of the specified `$meta_key`. @@ -707,10 +724,11 @@ function get_metadata_default( $meta_type, $object_id, $meta_key, $single = fals * Filters the default metadata value for a specified meta key and object. * * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type - * (post, comment, term, user, or any other type with an associated meta table). + * (blog, post, comment, term, user, or any other type with an associated meta table). * * Possible filter names include: * + * - `default_blog_metadata` * - `default_post_metadata` * - `default_comment_metadata` * - `default_term_metadata` @@ -723,8 +741,8 @@ function get_metadata_default( $meta_type, $object_id, $meta_key, $single = fals * @param int $object_id ID of the object metadata is for. * @param string $meta_key Metadata key. * @param bool $single Whether to return only the first value of the specified `$meta_key`. - * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. */ $value = apply_filters( "default_{$meta_type}_metadata", $value, $object_id, $meta_key, $single, $meta_type ); @@ -740,8 +758,8 @@ function get_metadata_default( $meta_type, $object_id, $meta_key, $single = fals * * @since 3.3.0 * - * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param int $object_id ID of the object metadata is for. * @param string $meta_key Metadata key. * @return bool Whether a meta field with the given key exists. @@ -783,8 +801,8 @@ function metadata_exists( $meta_type, $object_id, $meta_key ) { * * @global wpdb $wpdb WordPress database abstraction object. * - * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param int $meta_id ID for a specific meta row. * @return stdClass|false { * Metadata object, or boolean `false` if the metadata doesn't exist. @@ -793,6 +811,7 @@ function metadata_exists( $meta_type, $object_id, $meta_key ) { * @type mixed $meta_value The unserialized meta value. * @type string $meta_id Optional. The meta ID when the meta type is any value except 'user'. * @type string $umeta_id Optional. The meta ID when the meta type is 'user'. + * @type string $blog_id Optional. The object ID when the meta type is 'blog'. * @type string $post_id Optional. The object ID when the meta type is 'post'. * @type string $comment_id Optional. The object ID when the meta type is 'comment'. * @type string $term_id Optional. The object ID when the meta type is 'term'. @@ -820,11 +839,12 @@ function get_metadata_by_mid( $meta_type, $meta_id ) { * Short-circuits the return value when fetching a meta field by meta ID. * * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type - * (post, comment, term, user, or any other type with an associated meta table). + * (blog, post, comment, term, user, or any other type with an associated meta table). * Returning a non-null value will effectively short-circuit the function. * * Possible hook names include: * + * - `get_blog_metadata_by_mid` * - `get_post_metadata_by_mid` * - `get_comment_metadata_by_mid` * - `get_term_metadata_by_mid` @@ -862,8 +882,8 @@ function get_metadata_by_mid( $meta_type, $meta_id ) { * * @global wpdb $wpdb WordPress database abstraction object. * - * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param int $meta_id ID for a specific meta row. * @param string $meta_value Metadata value. Must be serializable if non-scalar. * @param string|false $meta_key Optional. You can provide a meta key to update it. Default false. @@ -894,11 +914,12 @@ function update_metadata_by_mid( $meta_type, $meta_id, $meta_value, $meta_key = * Short-circuits updating metadata of a specific type by meta ID. * * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type - * (post, comment, term, user, or any other type with an associated meta table). + * (blog, post, comment, term, user, or any other type with an associated meta table). * Returning a non-null value will effectively short-circuit the function. * * Possible hook names include: * + * - `update_blog_metadata_by_mid` * - `update_post_metadata_by_mid` * - `update_comment_metadata_by_mid` * - `update_term_metadata_by_mid` @@ -988,8 +1009,8 @@ function update_metadata_by_mid( $meta_type, $meta_id, $meta_value, $meta_key = * * @global wpdb $wpdb WordPress database abstraction object. * - * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param int $meta_id ID for a specific meta row. * @return bool True on successful delete, false on failure. */ @@ -1019,11 +1040,12 @@ function delete_metadata_by_mid( $meta_type, $meta_id ) { * Short-circuits deleting metadata of a specific type by meta ID. * * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type - * (post, comment, term, user, or any other type with an associated meta table). + * (blog, post, comment, term, user, or any other type with an associated meta table). * Returning a non-null value will effectively short-circuit the function. * * Possible hook names include: * + * - `delete_blog_metadata_by_mid` * - `delete_post_metadata_by_mid` * - `delete_comment_metadata_by_mid` * - `delete_term_metadata_by_mid` @@ -1059,8 +1081,6 @@ function delete_metadata_by_mid( $meta_type, $meta_id ) { * * - `delete_postmeta` * - `delete_commentmeta` - * - `delete_termmeta` - * - `delete_usermeta` * * @since 3.4.0 * @@ -1090,8 +1110,6 @@ function delete_metadata_by_mid( $meta_type, $meta_id ) { * * - `deleted_postmeta` * - `deleted_commentmeta` - * - `deleted_termmeta` - * - `deleted_usermeta` * * @since 3.4.0 * @@ -1115,8 +1133,8 @@ function delete_metadata_by_mid( $meta_type, $meta_id ) { * * @global wpdb $wpdb WordPress database abstraction object. * - * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param string|int[] $object_ids Array or comma delimited list of object IDs to update cache for. * @return array|false Metadata cache for the specified objects, or false on failure. */ @@ -1145,11 +1163,12 @@ function update_meta_cache( $meta_type, $object_ids ) { * Short-circuits updating the metadata cache of a specific type. * * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type - * (post, comment, term, user, or any other type with an associated meta table). + * (blog, post, comment, term, user, or any other type with an associated meta table). * Returning a non-null value will effectively short-circuit the function. * * Possible hook names include: * + * - `update_blog_metadata_cache` * - `update_post_metadata_cache` * - `update_comment_metadata_cache` * - `update_term_metadata_cache` @@ -1268,8 +1287,8 @@ function get_meta_sql( $meta_query, $type, $primary_table, $primary_id_column, $ * * @global wpdb $wpdb WordPress database abstraction object. * - * @param string $type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @return string|false Metadata table name, or false if no metadata table exists */ function _get_meta_table( $type ) { @@ -1290,8 +1309,8 @@ function _get_meta_table( $type ) { * @since 3.1.3 * * @param string $meta_key Metadata key. - * @param string $meta_type Optional. Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. Default empty string. + * @param string $meta_type Optional. Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. Default empty string. * @return bool Whether the meta key is considered protected. */ function is_protected_meta( $meta_key, $meta_type = '' ) { @@ -1305,8 +1324,8 @@ function is_protected_meta( $meta_key, $meta_type = '' ) { * * @param bool $protected Whether the key is considered protected. * @param string $meta_key Metadata key. - * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. */ return apply_filters( 'is_protected_meta', $protected, $meta_key, $meta_type ); } @@ -1319,8 +1338,8 @@ function is_protected_meta( $meta_key, $meta_type = '' ) { * * @param string $meta_key Metadata key. * @param mixed $meta_value Metadata value to sanitize. - * @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $object_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param string $object_subtype Optional. The subtype of the object type. Default empty string. * @return mixed Sanitized $meta_value. */ @@ -1331,15 +1350,15 @@ function sanitize_meta( $meta_key, $meta_value, $object_type, $object_subtype = * Filters the sanitization of a specific meta key of a specific meta type and subtype. * * The dynamic portions of the hook name, `$object_type`, `$meta_key`, - * and `$object_subtype`, refer to the metadata object type (comment, post, term, or user), + * and `$object_subtype`, refer to the metadata object type (blog, comment, post, term, or user), * the meta key value, and the object subtype respectively. * * @since 4.9.8 * * @param mixed $meta_value Metadata value to sanitize. * @param string $meta_key Metadata key. - * @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $object_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param string $object_subtype Object subtype. */ return apply_filters( "sanitize_{$object_type}_meta_{$meta_key}_for_{$object_subtype}", $meta_value, $meta_key, $object_type, $object_subtype ); @@ -1349,15 +1368,15 @@ function sanitize_meta( $meta_key, $meta_value, $object_type, $object_subtype = * Filters the sanitization of a specific meta key of a specific meta type. * * The dynamic portions of the hook name, `$meta_type`, and `$meta_key`, - * refer to the metadata object type (comment, post, term, or user) and the meta + * refer to the metadata object type (blog, comment, post, term, or user) and the meta * key value, respectively. * * @since 3.3.0 * * @param mixed $meta_value Metadata value to sanitize. * @param string $meta_key Metadata key. - * @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $object_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. */ return apply_filters( "sanitize_{$object_type}_meta_{$meta_key}", $meta_value, $meta_key, $object_type ); } @@ -1369,7 +1388,7 @@ function sanitize_meta( $meta_key, $meta_value, $object_type, $object_subtype = * an object subtype is omitted, the meta key will be registered for the entire object type, however it can be partly * overridden in case a more specific meta key of the same name exists for the same object type and a subtype. * - * If an object type does not support any subtypes, such as users or comments, you should commonly call this function + * If an object type does not support any subtypes, such as blogs, users, or comments, you should commonly call this function * without passing a subtype. * * @since 3.3.0 @@ -1382,8 +1401,8 @@ function sanitize_meta( $meta_key, $meta_value, $object_type, $object_subtype = * @since 6.4.0 The `$revisions_enabled` argument was added to the arguments array. * @since 6.7.0 The `label` argument was added to the arguments array. * - * @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $object_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param string $meta_key Meta key to register. * @param array $args { * Data used to describe the meta key when registered. @@ -1461,8 +1480,8 @@ function register_meta( $object_type, $meta_key, $args, $deprecated = null ) { * * @param array $args Array of meta registration arguments. * @param array $defaults Array of default arguments. - * @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $object_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param string $meta_key Meta key. */ $args = apply_filters( 'register_meta_args', $args, $defaults, $object_type, $meta_key ); @@ -1557,8 +1576,8 @@ function register_meta( $object_type, $meta_key, $args, $deprecated = null ) { * @param string $meta_key Metadata key. * @param bool $single If true, return only the first value of the specified `$meta_key`. * This parameter has no effect if `$meta_key` is not specified. - * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @return mixed An array of default values if `$single` is false. * The default value of the meta field if `$single` is true. */ @@ -1612,8 +1631,8 @@ function filter_default_metadata( $value, $object_id, $meta_key, $single, $meta_ * @since 4.6.0 * @since 4.9.8 The `$object_subtype` parameter was added. * - * @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $object_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param string $meta_key Metadata key. * @param string $object_subtype Optional. The subtype of the object type. Default empty string. * @return bool True if the meta key is registered to the object type and, if provided, @@ -1631,8 +1650,8 @@ function registered_meta_key_exists( $object_type, $meta_key, $object_subtype = * @since 4.6.0 * @since 4.9.8 The `$object_subtype` parameter was added. * - * @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $object_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param string $meta_key Metadata key. * @param string $object_subtype Optional. The subtype of the object type. Default empty string. * @return bool True if successful. False if the meta key was not registered. @@ -1681,8 +1700,8 @@ function unregister_meta_key( $object_type, $meta_key, $object_subtype = '' ) { * @since 4.6.0 * @since 4.9.8 The `$object_subtype` parameter was added. * - * @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $object_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param string $object_subtype Optional. The subtype of the object type. Default empty string. * @return array[] List of registered metadata args, keyed by their meta keys. */ @@ -1704,8 +1723,8 @@ function get_registered_meta_keys( $object_type, $object_subtype = '' ) { * * @since 4.6.0 * - * @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $object_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param int $object_id ID of the object the metadata is for. * @param string $meta_key Optional. Registered metadata key. If not specified, retrieve all registered * metadata for the specified object. @@ -1767,8 +1786,8 @@ function _wp_register_meta_args_allowed_list( $args, $default_args ) { * * @since 4.9.8 * - * @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $object_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param int $object_id ID of the object to retrieve its subtype. * @return string The object subtype or an empty string if unspecified subtype. */ @@ -1814,13 +1833,14 @@ function get_object_subtype( $object_type, $object_id ) { } /** - * Filters the object subtype identifier for a non-standard object type. + * Filters the object subtype identifier. * * The dynamic portion of the hook name, `$object_type`, refers to the meta object type - * (post, comment, term, user, or any other type with an associated meta table). + * (blog, post, comment, term, user, or any other type with an associated meta table). * * Possible hook names include: * + * - `get_object_subtype_blog` * - `get_object_subtype_post` * - `get_object_subtype_comment` * - `get_object_subtype_term` @@ -1828,7 +1848,7 @@ function get_object_subtype( $object_type, $object_id ) { * * @since 4.9.8 * - * @param string $object_subtype Empty string to override. + * @param string $object_subtype Object subtype or empty string to override. * @param int $object_id ID of the object to get the subtype for. */ return apply_filters( "get_object_subtype_{$object_type}", $object_subtype, $object_id ); diff --git a/src/wp-includes/ms-load.php b/src/wp-includes/ms-load.php index 0708bc4dcd..b8d5228d09 100644 --- a/src/wp-includes/ms-load.php +++ b/src/wp-includes/ms-load.php @@ -129,9 +129,9 @@ function ms_site_check() { /** * Retrieves the closest matching network for a domain and path. * - * @since 3.9.0 + * {@internal In 4.4.0, converted to a wrapper for WP_Network::get_by_path()} * - * @internal In 4.4.0, converted to a wrapper for WP_Network::get_by_path() + * @since 3.9.0 * * @param string $domain Domain to check. * @param string $path Path to check. @@ -552,12 +552,12 @@ function wpmu_current_site() { /** * Retrieves an object containing information about the requested network. * + * {@internal In 4.6.0, converted to use get_network()} + * * @since 3.9.0 * @deprecated 4.7.0 Use get_network() * @see get_network() * - * @internal In 4.6.0, converted to use get_network() - * * @param object|int $network The network's database row or ID. * @return WP_Network|false Object containing network information if found, false if not. */ diff --git a/src/wp-includes/ms-site.php b/src/wp-includes/ms-site.php index 2a2b1474c5..a8d9f8e2b6 100644 --- a/src/wp-includes/ms-site.php +++ b/src/wp-includes/ms-site.php @@ -1022,6 +1022,8 @@ function clean_blog_cache( $blog ) { /** * Adds metadata to a site. * + * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input. + * * @since 5.1.0 * * @param int $site_id Site ID. @@ -1048,6 +1050,8 @@ function add_site_meta( $site_id, $meta_key, $meta_value, $unique = false ) { * value, will keep from removing duplicate metadata with the same key. It also * allows removing all metadata matching key, if needed. * + * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input. + * * @since 5.1.0 * * @param int $site_id Site ID. @@ -1090,11 +1094,13 @@ function get_site_meta( $site_id, $key = '', $single = false ) { /** * Updates metadata for a site. * - * Use the $prev_value parameter to differentiate between meta fields with the + * Use the `$prev_value` parameter to differentiate between meta fields with the * same key and site ID. * * If the meta field for the site does not exist, it will be added. * + * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input. + * * @since 5.1.0 * * @param int $site_id Site ID. diff --git a/src/wp-includes/pluggable.php b/src/wp-includes/pluggable.php index e7ce2edb41..c6a0c6e24e 100644 --- a/src/wp-includes/pluggable.php +++ b/src/wp-includes/pluggable.php @@ -3048,6 +3048,8 @@ if ( ! function_exists( 'get_avatar' ) ) : * - 'monsterid' (a monster) * - 'wavatar' (a cartoon face) * - 'identicon' (the "quilt", a geometric pattern) + * - 'initials' (initials based avatar with background color) + * - 'color' (generated background color) * - 'mystery', 'mm', or 'mysteryman' (The Oyster Man) * - 'blank' (transparent GIF) * - 'gravatar_default' (the Gravatar logo) diff --git a/src/wp-includes/plugin.php b/src/wp-includes/plugin.php index bed67a9d96..5b4079b0bd 100644 --- a/src/wp-includes/plugin.php +++ b/src/wp-includes/plugin.php @@ -359,7 +359,7 @@ function remove_all_filters( $hook_name, $priority = false ) { * * @global string[] $wp_current_filter Stores the list of current filters with the current one last * - * @return string Hook name of the current filter. + * @return string|false Hook name of the current filter, false if no filter is running. */ function current_filter() { global $wp_current_filter; @@ -632,7 +632,7 @@ function remove_all_actions( $hook_name, $priority = false ) { * * @since 3.9.0 * - * @return string Hook name of the current action. + * @return string|false Hook name of the current action, false if no action is running. */ function current_action() { return current_filter(); diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php index 19fada6383..bd749b2f82 100644 --- a/src/wp-includes/post.php +++ b/src/wp-includes/post.php @@ -2608,6 +2608,8 @@ function get_posts( $args = null ) { * * Post meta data is called "Custom Fields" on the Administration Screen. * + * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input. + * * @since 1.5.0 * * @param int $post_id Post ID. @@ -2640,6 +2642,8 @@ function add_post_meta( $post_id, $meta_key, $meta_value, $unique = false ) { * value, will keep from removing duplicate metadata with the same key. It also * allows removing all metadata matching the key, if needed. * + * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input. + * * @since 1.5.0 * * @param int $post_id Post ID. @@ -2695,6 +2699,8 @@ function get_post_meta( $post_id, $key = '', $single = false ) { * * Can be used in place of add_post_meta(). * + * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input. + * * @since 1.5.0 * * @param int $post_id Post ID. diff --git a/src/wp-includes/rest-api/class-wp-rest-response.php b/src/wp-includes/rest-api/class-wp-rest-response.php index c6ea11be83..0861d190d0 100644 --- a/src/wp-includes/rest-api/class-wp-rest-response.php +++ b/src/wp-includes/rest-api/class-wp-rest-response.php @@ -43,7 +43,7 @@ class WP_REST_Response extends WP_HTTP_Response { /** * Adds a link to the response. * - * @internal The $rel parameter is first, as this looks nicer when sending multiple. + * {@internal The $rel parameter is first, as this looks nicer when sending multiple.} * * @since 4.4.0 * @@ -135,7 +135,7 @@ class WP_REST_Response extends WP_HTTP_Response { /** * Sets a single link header. * - * @internal The $rel parameter is first, as this looks nicer when sending multiple. + * {@internal The $rel parameter is first, as this looks nicer when sending multiple.} * * @since 4.4.0 * diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-controller.php index 4b960d6c6b..0474613b2e 100644 --- a/src/wp-includes/rest-api/endpoints/class-wp-rest-controller.php +++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-controller.php @@ -662,11 +662,11 @@ abstract class WP_REST_Controller { /** * Sanitizes the slug value. * - * @since 4.7.0 - * - * @internal We can't use sanitize_title() directly, as the second + * {@internal We can't use sanitize_title() directly, as the second * parameter is the fallback title, which would end up being set to the - * request object. + * request object.} + * + * @since 4.7.0 * * @see https://github.com/WP-API/WP-API/issues/1585 * diff --git a/src/wp-includes/taxonomy.php b/src/wp-includes/taxonomy.php index 3e235b780f..e78f281eee 100644 --- a/src/wp-includes/taxonomy.php +++ b/src/wp-includes/taxonomy.php @@ -1292,6 +1292,8 @@ function get_term_to_edit( $id, $taxonomy ) { * * Prior to 4.5.0, taxonomy was passed as the first parameter of `get_terms()`. * + * {@internal The `$deprecated` parameter is parsed for backward compatibility only.} + * * @since 2.3.0 * @since 4.2.0 Introduced 'name' and 'childless' parameters. * @since 4.4.0 Introduced the ability to pass 'term_id' as an alias of 'id' for the `orderby` parameter. @@ -1301,8 +1303,6 @@ function get_term_to_edit( $id, $taxonomy ) { * Introduced 'meta_key' and 'meta_value' parameters. Introduced the ability to order results by metadata. * @since 4.8.0 Introduced 'suppress_filter' parameter. * - * @internal The `$deprecated` parameter is parsed for backward compatibility only. - * * @param array|string $args Optional. Array or string of arguments. See WP_Term_Query::__construct() * for information on accepted arguments. Default empty array. * @param array|string $deprecated Optional. Argument array, when using the legacy function parameter format. @@ -1382,6 +1382,8 @@ function get_terms( $args = array(), $deprecated = '' ) { /** * Adds metadata to a term. * + * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input. + * * @since 4.4.0 * * @param int $term_id Term ID. @@ -1409,6 +1411,8 @@ function add_term_meta( $term_id, $meta_key, $meta_value, $unique = false ) { /** * Removes metadata matching criteria from a term. * + * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input. + * * @since 4.4.0 * * @param int $term_id Term ID. @@ -1455,6 +1459,8 @@ function get_term_meta( $term_id, $key = '', $single = false ) { * * If the meta field for the term does not exist, it will be added. * + * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input. + * * @since 4.4.0 * * @param int $term_id Term ID. @@ -1927,11 +1933,11 @@ function sanitize_term_field( $field, $value, $term_id, $taxonomy, $context ) { * * Default $args is 'hide_empty' which can be 'hide_empty=true' or array('hide_empty' => true). * + * {@internal The `$deprecated` parameter is parsed for backward compatibility only.} + * * @since 2.3.0 * @since 5.6.0 Changed the function signature so that the `$args` array can be provided as the first parameter. * - * @internal The `$deprecated` parameter is parsed for backward compatibility only. - * * @param array|string $args Optional. Array or string of arguments. See WP_Term_Query::__construct() * for information on accepted arguments. Default empty array. * @param array|string $deprecated Optional. Argument array, when using the legacy function parameter format. diff --git a/src/wp-includes/theme.php b/src/wp-includes/theme.php index b4a71d855a..0727086aee 100644 --- a/src/wp-includes/theme.php +++ b/src/wp-includes/theme.php @@ -4349,6 +4349,8 @@ function create_initial_theme_features() { * * @since 5.9.0 * + * @global string[] $wp_theme_directories + * * @return bool Whether the active theme is a block-based theme or not. */ function wp_is_block_theme() { diff --git a/src/wp-includes/user.php b/src/wp-includes/user.php index 6d53726327..c3df9229bf 100644 --- a/src/wp-includes/user.php +++ b/src/wp-includes/user.php @@ -1202,6 +1202,8 @@ function is_user_member_of_blog( $user_id = 0, $blog_id = 0 ) { /** * Adds meta data to a user. * + * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input. + * * @since 3.0.0 * * @param int $user_id User ID. @@ -1228,6 +1230,8 @@ function add_user_meta( $user_id, $meta_key, $meta_value, $unique = false ) { * value, will keep from removing duplicate metadata with the same key. It also * allows removing all metadata matching key, if needed. * + * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input. + * * @since 3.0.0 * * @link https://developer.wordpress.org/reference/functions/delete_user_meta/ @@ -1279,6 +1283,8 @@ function get_user_meta( $user_id, $key = '', $single = false ) { * * If the meta field for the user does not exist, it will be added. * + * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input. + * * @since 3.0.0 * * @link https://developer.wordpress.org/reference/functions/update_user_meta/ |