get_{$meta_type}_metadata

get_{$meta_type}_metadata

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter
See hook in action

See hook in core

Displaying hooks found in version: wordpress-6.7.1

apply_filters('get_{$meta_type}_metadata') is found 2 times:

  • /wp-includes/meta.php line 636
    632
    633
    634
    635
    636
    637
    638
    639
    640
    641
    642
    * @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.
     */
    $check = apply_filters( "get_{$meta_type}_metadata", null, $object_id, $meta_key, $single, $meta_type );
    if ( null !== $check ) {
        if ( $single && is_array( $check ) ) {
            return $check[0];
        } else {
            return $check;
        }
  • /wp-includes/meta.php line 749
    745
    746
    747
    748
    749
    750
    751
    752
    753
    754
        return false;
    }
     
    /** This filter is documented in wp-includes/meta.php */
    $check = apply_filters( "get_{$meta_type}_metadata", null, $object_id, $meta_key, true, $meta_type );
    if ( null !== $check ) {
        return (bool) $check;
    }
     
    $meta_cache = wp_cache_get( $object_id, $meta_type . '_meta' );

See this hook used in plugins: