Filters terms lookup to set the post format.
Parameters
$terms
arrayrequired$post_id
intrequired$taxonomy
stringrequired
Source
|| 'post_format' !== $taxonomy || 'revision' === $post->post_type
) {
return $terms;
}
if ( 'standard' === $_REQUEST['post_format'] ) {
$terms = array();
} else {
$term = get_term_by( 'slug', 'post-format-' . sanitize_key( $_REQUEST['post_format'] ), 'post_format' );
if ( $term ) {
$terms = array( $term ); // Can only have one post format.
}
}
return $terms;
}
/**
* Filters post thumbnail lookup to set the post thumbnail.
*
* @since 4.6.0
* @access private
*
* @param null|array|string $value The value to return - a single metadata value, or an array of values.
Changelog
Version | Description |
---|---|
3.6.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.