get_post_format_link()
Returns a link to a post format index.
No Hooks.
Returns
String|WP_Error|false. The post format term link.
Usage
get_post_format_link( $format );
- $format(string) (required)
- The post format slug.
Changelog
| Since 3.1.0 | Introduced. |
get_post_format_link() get post format link code WP 6.9.1
function get_post_format_link( $format ) {
$term = get_term_by( 'slug', 'post-format-' . $format, 'post_format' );
if ( ! $term || is_wp_error( $term ) ) {
return false;
}
return get_term_link( $term );
}