WordPress at Your Fingertips
function is not described

_post_format_link() WP 3.1.0

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

This is an internal function for using it by WP core itself. It's not recommended to use this function in your code.

No Hooks.

Return

String.

Usage

_post_format_link( $link, $term, $taxonomy );
$link(string) (required)
-
$term(WP_Term) (required)
-
$taxonomy(string) (required)
-

Notes

  • Global. WP_Rewrite. $wp_rewrite WordPress rewrite component.

Changelog

Since 3.1.0 Introduced.

Code of _post_format_link() WP 5.7.2

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