--- a/wp/wp-includes/meta.php Wed Sep 21 18:19:35 2022 +0200
+++ b/wp/wp-includes/meta.php Tue Sep 27 16:37:53 2022 +0200
@@ -56,10 +56,17 @@
/**
* Short-circuits adding metadata of a specific type.
*
- * The dynamic portion of the hook, `$meta_type`, refers to the meta object 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).
* Returning a non-null value will effectively short-circuit the function.
*
+ * Possible hook names include:
+ *
+ * - `add_post_metadata`
+ * - `add_comment_metadata`
+ * - `add_term_metadata`
+ * - `add_user_metadata`
+ *
* @since 3.1.0
*
* @param null|bool $check Whether to allow adding metadata for the given type.
@@ -89,14 +96,21 @@
/**
* Fires immediately before meta of a specific type is added.
*
- * The dynamic portion of the hook, `$meta_type`, refers to the meta object 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).
*
+ * Possible hook names include:
+ *
+ * - `add_post_meta`
+ * - `add_comment_meta`
+ * - `add_term_meta`
+ * - `add_user_meta`
+ *
* @since 3.1.0
*
* @param int $object_id ID of the object metadata is for.
* @param string $meta_key Metadata key.
- * @param mixed $_meta_value Metadata value. Serialized if non-scalar.
+ * @param mixed $_meta_value Metadata value.
*/
do_action( "add_{$meta_type}_meta", $object_id, $meta_key, $_meta_value );
@@ -120,15 +134,22 @@
/**
* Fires immediately after meta of a specific type is added.
*
- * The dynamic portion of the hook, `$meta_type`, refers to the meta object 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).
*
+ * Possible hook names include:
+ *
+ * - `added_post_meta`
+ * - `added_comment_meta`
+ * - `added_term_meta`
+ * - `added_user_meta`
+ *
* @since 2.9.0
*
* @param int $mid The meta ID after successful update.
* @param int $object_id ID of the object metadata is for.
* @param string $meta_key Metadata key.
- * @param mixed $_meta_value Metadata value. Serialized if non-scalar.
+ * @param mixed $_meta_value Metadata value.
*/
do_action( "added_{$meta_type}_meta", $mid, $object_id, $meta_key, $_meta_value );
@@ -188,10 +209,17 @@
/**
* Short-circuits updating metadata of a specific type.
*
- * The dynamic portion of the hook, `$meta_type`, refers to the meta object 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).
* Returning a non-null value will effectively short-circuit the function.
*
+ * Possible hook names include:
+ *
+ * - `update_post_metadata`
+ * - `update_comment_metadata`
+ * - `update_term_metadata`
+ * - `update_user_metadata`
+ *
* @since 3.1.0
*
* @param null|bool $check Whether to allow updating metadata for the given type.
@@ -240,15 +268,22 @@
/**
* Fires immediately before updating metadata of a specific type.
*
- * The dynamic portion of the hook, `$meta_type`, refers to the meta object 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).
*
+ * Possible hook names include:
+ *
+ * - `update_post_meta`
+ * - `update_comment_meta`
+ * - `update_term_meta`
+ * - `update_user_meta`
+ *
* @since 2.9.0
*
* @param int $meta_id ID of the metadata entry to update.
* @param int $object_id ID of the object metadata is for.
* @param string $meta_key Metadata key.
- * @param mixed $_meta_value Metadata value. Serialized if non-scalar.
+ * @param mixed $_meta_value Metadata value.
*/
do_action( "update_{$meta_type}_meta", $meta_id, $object_id, $meta_key, $_meta_value );
@@ -279,15 +314,22 @@
/**
* Fires immediately after updating metadata of a specific type.
*
- * The dynamic portion of the hook, `$meta_type`, refers to the meta object 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).
*
+ * Possible hook names include:
+ *
+ * - `updated_post_meta`
+ * - `updated_comment_meta`
+ * - `updated_term_meta`
+ * - `updated_user_meta`
+ *
* @since 2.9.0
*
* @param int $meta_id ID of updated metadata entry.
* @param int $object_id ID of the object metadata is for.
* @param string $meta_key Metadata key.
- * @param mixed $_meta_value Metadata value. Serialized if non-scalar.
+ * @param mixed $_meta_value Metadata value.
*/
do_action( "updated_{$meta_type}_meta", $meta_id, $object_id, $meta_key, $_meta_value );
@@ -359,10 +401,17 @@
/**
* Short-circuits deleting metadata of a specific type.
*
- * The dynamic portion of the hook, `$meta_type`, refers to the meta object 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).
* Returning a non-null value will effectively short-circuit the function.
*
+ * Possible hook names include:
+ *
+ * - `delete_post_metadata`
+ * - `delete_comment_metadata`
+ * - `delete_term_metadata`
+ * - `delete_user_metadata`
+ *
* @since 3.1.0
*
* @param null|bool $delete Whether to allow metadata deletion of the given type.
@@ -407,15 +456,22 @@
/**
* Fires immediately before deleting metadata of a specific type.
*
- * The dynamic portion of the hook, `$meta_type`, refers to the meta object 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).
*
+ * Possible hook names include:
+ *
+ * - `delete_post_meta`
+ * - `delete_comment_meta`
+ * - `delete_term_meta`
+ * - `delete_user_meta`
+ *
* @since 3.1.0
*
* @param string[] $meta_ids An array of metadata entry IDs to delete.
* @param int $object_id ID of the object metadata is for.
* @param string $meta_key Metadata key.
- * @param mixed $_meta_value Metadata value. Serialized if non-scalar.
+ * @param mixed $_meta_value Metadata value.
*/
do_action( "delete_{$meta_type}_meta", $meta_ids, $object_id, $meta_key, $_meta_value );
@@ -440,25 +496,31 @@
}
if ( $delete_all ) {
- foreach ( (array) $object_ids as $o_id ) {
- wp_cache_delete( $o_id, $meta_type . '_meta' );
- }
+ $data = (array) $object_ids;
} else {
- wp_cache_delete( $object_id, $meta_type . '_meta' );
+ $data = array( $object_id );
}
+ wp_cache_delete_multiple( $data, $meta_type . '_meta' );
/**
* Fires immediately after deleting metadata of a specific type.
*
- * The dynamic portion of the hook, `$meta_type`, refers to the meta object 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).
*
+ * Possible hook names include:
+ *
+ * - `deleted_post_meta`
+ * - `deleted_comment_meta`
+ * - `deleted_term_meta`
+ * - `deleted_user_meta`
+ *
* @since 2.9.0
*
* @param string[] $meta_ids An array of metadata entry IDs to delete.
* @param int $object_id ID of the object metadata is for.
* @param string $meta_key Metadata key.
- * @param mixed $_meta_value Metadata value. Serialized if non-scalar.
+ * @param mixed $_meta_value Metadata value.
*/
do_action( "deleted_{$meta_type}_meta", $meta_ids, $object_id, $meta_key, $_meta_value );
@@ -545,7 +607,7 @@
/**
* Short-circuits the return value of a meta field.
*
- * The dynamic portion of the hook, `$meta_type`, refers to the meta object 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).
* Returning a non-null value will effectively short-circuit the function.
*
@@ -629,7 +691,7 @@
/**
* Filters the default metadata value for a specified meta key and object.
*
- * The dynamic portion of the hook, `$meta_type`, refers to the meta object 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).
*
* Possible filter names include:
@@ -742,10 +804,17 @@
/**
* Short-circuits the return value when fetching a meta field by meta ID.
*
- * The dynamic portion of the hook, `$meta_type`, refers to the meta object 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).
* Returning a non-null value will effectively short-circuit the function.
*
+ * Possible hook names include:
+ *
+ * - `get_post_metadata_by_mid`
+ * - `get_comment_metadata_by_mid`
+ * - `get_term_metadata_by_mid`
+ * - `get_user_metadata_by_mid`
+ *
* @since 5.0.0
*
* @param stdClass|null $value The value to return.
@@ -809,10 +878,17 @@
/**
* Short-circuits updating metadata of a specific type by meta ID.
*
- * The dynamic portion of the hook, `$meta_type`, refers to the meta object 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).
* Returning a non-null value will effectively short-circuit the function.
*
+ * Possible hook names include:
+ *
+ * - `update_post_metadata_by_mid`
+ * - `update_comment_metadata_by_mid`
+ * - `update_term_metadata_by_mid`
+ * - `update_user_metadata_by_mid`
+ *
* @since 5.0.0
*
* @param null|bool $check Whether to allow updating metadata for the given type.
@@ -925,10 +1001,17 @@
/**
* Short-circuits deleting metadata of a specific type by meta ID.
*
- * The dynamic portion of the hook, `$meta_type`, refers to the meta object 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).
* Returning a non-null value will effectively short-circuit the function.
*
+ * Possible hook names include:
+ *
+ * - `delete_post_metadata_by_mid`
+ * - `delete_comment_metadata_by_mid`
+ * - `delete_term_metadata_by_mid`
+ * - `delete_user_metadata_by_mid`
+ *
* @since 5.0.0
*
* @param null|bool $delete Whether to allow metadata deletion of the given type.
@@ -952,9 +1035,16 @@
/**
* Fires immediately before deleting post or comment metadata of a specific type.
*
- * The dynamic portion of the hook, `$meta_type`, refers to the meta
+ * The dynamic portion of the hook name, `$meta_type`, refers to the meta
* object type (post or comment).
*
+ * Possible hook names include:
+ *
+ * - `delete_postmeta`
+ * - `delete_commentmeta`
+ * - `delete_termmeta`
+ * - `delete_usermeta`
+ *
* @since 3.4.0
*
* @param int $meta_id ID of the metadata entry to delete.
@@ -976,9 +1066,16 @@
/**
* Fires immediately after deleting post or comment metadata of a specific type.
*
- * The dynamic portion of the hook, `$meta_type`, refers to the meta
+ * The dynamic portion of the hook name, `$meta_type`, refers to the meta
* object type (post or comment).
*
+ * Possible hook names include:
+ *
+ * - `deleted_postmeta`
+ * - `deleted_commentmeta`
+ * - `deleted_termmeta`
+ * - `deleted_usermeta`
+ *
* @since 3.4.0
*
* @param int $meta_ids Deleted metadata entry ID.
@@ -1030,10 +1127,17 @@
/**
* Short-circuits updating the metadata cache of a specific type.
*
- * The dynamic portion of the hook, `$meta_type`, refers to the meta object 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).
* Returning a non-null value will effectively short-circuit the function.
*
+ * Possible hook names include:
+ *
+ * - `update_post_metadata_cache`
+ * - `update_comment_metadata_cache`
+ * - `update_term_metadata_cache`
+ * - `update_user_metadata_cache`
+ *
* @since 5.0.0
*
* @param mixed $check Whether to allow updating the meta cache of the given type.
@@ -1086,12 +1190,14 @@
}
}
+ $data = array();
foreach ( $non_cached_ids as $id ) {
if ( ! isset( $cache[ $id ] ) ) {
$cache[ $id ] = array();
}
- wp_cache_add( $id, $cache[ $id ], $cache_key );
+ $data[ $id ] = $cache[ $id ];
}
+ wp_cache_add_multiple( $data, $cache_key );
return $cache;
}
@@ -1669,9 +1775,16 @@
/**
* Filters the object subtype identifier for a non-standard object type.
*
- * The dynamic portion of the hook, `$object_type`, refers to the meta object type
+ * 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).
*
+ * Possible hook names include:
+ *
+ * - `get_object_subtype_post`
+ * - `get_object_subtype_comment`
+ * - `get_object_subtype_term`
+ * - `get_object_subtype_user`
+ *
* @since 4.9.8
*
* @param string $object_subtype Empty string to override.