Un motore di ricerca WordPress per sviluppatori e autori di temi



_post_format_link ›

Da3.1.0
Deprecaton/a
_post_format_link ( $link, $term, $taxonomy )
Accedi:
  • private
Parametri: (3)
  • (string) $link
    Richiesto:
  • (object) $term
    Richiesto:
  • (string) $taxonomy
    Richiesto:
Ritorna:
  • (string)
Definito a:
Codex:

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



Sorgenti

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