wpseek.com
WordPress开发者和主题制作者的搜索引擎



_post_format_link › WordPress Function

Since3.1.0
已弃用n/a
_post_format_link ( $link, $term, $taxonomy )
访问:
  • private
参数: (3)
  • (string) $link
    Required: Yes
  • (WP_Term) $term
    Required: Yes
  • (string) $taxonomy
    Required: Yes
返回:
  • (string)
定义在:
文档:

Filters the post format term link to remove the format prefix.



源码

function _post_format_link( $link, $term, $taxonomy ) {
	global $wp_rewrite;
	if ( 'post_format' !== $taxonomy ) {
		return $link;
	}
	if ( $wp_rewrite->get_extra_permastruct( $taxonomy ) ) {
		return str_replace( "/{$term->slug}", '/' . str_replace( 'post-format-', '', $term->slug ), $link );
	} else {
		$link = remove_query_arg( 'post_format', $link );
		return add_query_arg( 'post_format', str_replace( 'post-format-', '', $term->slug ), $link );
	}
}