get_post_format_link

函数


get_post_format_link ( $format )
参数
  • (string)
    $format
    The post format slug.
    Required:
返回值
  • (string|WP_Error|false) The post format term link.
定义位置
  • wp-includes/post-formats.php
    , line 149
引入
3.1.0
弃用

返回一个指向文章格式索引的链接。

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 );
}