get_post_format_slugs() WordPress Function

The get_post_format_slugs() function is used to retrieve the slugs for each post format.

get_post_format_slugs() #

Retrieves the array of post format slugs.


Return

(string[]) The array of post format slugs as both keys and values.


Top ↑

Source

File: wp-includes/post-formats.php

function get_post_format_slugs() {
	$slugs = array_keys( get_post_format_strings() );
	return array_combine( $slugs, $slugs );
}


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.