Returns a link to a post format index.
$formatstringrequired
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 );
}
| Version | Description |
|---|---|
| 3.1.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_post_format_link