mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-03 12:14:25 +00:00
Meta: Remove object subtype handling from register_meta().
Registration is now based solely on object type, which allows the code around this to be simplified significantly. In the process of making this adjustment: * `register_meta()`, `unregister_meta_key()`, `get_registered_metadata()`, and `registered_meta_key_exists()` no longer return `WP_Error` objects. * The recently introduced `wp_object_type_exists()` function and the restriction on object type has been removed. Note: No guarantee of uniqueness is made across object subtypes. Registered meta keys should be uniquely prefixed to avoid conflict. Fixes #35658. git-svn-id: https://develop.svn.wordpress.org/trunk@38095 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -5357,31 +5357,6 @@ function mysql_to_rfc3339( $date_string ) {
|
||||
return preg_replace( '/(?:Z|[+-]\d{2}(?::\d{2})?)$/', '', $formatted );
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if an object type exists. By default, these are `post`, `comment`, `user`, and `term`.
|
||||
*
|
||||
* @since 4.6.0
|
||||
*
|
||||
* @param string $object_type Object type to check.
|
||||
* @return bool True if the object type exists, false if not.
|
||||
*/
|
||||
function wp_object_type_exists( $object_type ) {
|
||||
/**
|
||||
* Filters WordPress object types.
|
||||
*
|
||||
* @since 4.6.0
|
||||
*
|
||||
* @param array $types Array of object types.
|
||||
*/
|
||||
$types = apply_filters( 'wp_object_types', array( 'post', 'comment', 'user', 'term' ) );
|
||||
|
||||
if ( in_array( $object_type, $types ) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempts to raise the PHP memory limit for memory intensive processes.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user