get_object_subtype_(object_type)
Filters the object subtype identifier.
The dynamic portion of the hook name, $object_type, refers to the meta object type (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
- get_object_subtype_user
Usage
add_filter( 'get_object_subtype_(object_type)', 'wp_kama_get_object_subtype_type_filter', 10, 2 );
/**
* Function for `get_object_subtype_(object_type)` filter-hook.
*
* @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 string
*/
function wp_kama_get_object_subtype_type_filter( $object_subtype, $object_id ){
// filter...
return $object_subtype;
}
- $object_subtype(string)
- Object subtype or empty string to override.
- $object_id(int)
- ID of the object to get the subtype for.
Changelog
| Since 4.9.8 | Introduced. |
Where the hook is called
get_object_subtype_(object_type)
wp-includes/meta.php 1854
return apply_filters( "get_object_subtype_{$object_type}", $object_subtype, $object_id );