函数原型
get_post_format_link( string $format ): string|WP_Error|false
函数描述
Returns a link to a post format index.
是否弃用
未弃用
函数参数
-
$format
string
Required - The post format slug.
函数返回值
string|WP_Error|false The post format term link.
函数位置
File: wp-includes/post-formats.php.
函数源码
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. |

