_post_format_link() – Filters the post format term link to remove the format prefix.

You appear to be a bot. Output may be restricted

Description

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

Usage

$string = _post_format_link( $link, $term, $taxonomy );

Parameters

$link
( string ) required
$term
( WP_Term ) required
$taxonomy
( string ) required

Returns

string

Source

File name: wordpress/wp-includes/post-formats.php
Lines:

1 to 12 of 12
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 );
  }
}
 

 View on GitHub View on Trac