get_post_format_link() WordPress Function

The get_post_format_link() function is used to get the permalink for a post format archive.

get_post_format_link( string $format ) #

Returns a link to a post format index.


Parameters

$format

(string)(Required)The post format slug.


Top ↑

Return

(string|WP_Error|false) The post format term link.


Top ↑

Source

File: wp-includes/post-formats.php

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


Top ↑

Changelog

Changelog
VersionDescription
3.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.