On this page
get_post_format_slugs(): string[]
Retrieves the array of post format slugs.
Return
string[] The array of post format slugs as both keys and values.
Source
File: wp-includes/post-formats.php. View all references
function get_post_format_slugs() {
$slugs = array_keys( get_post_format_strings() );
return array_combine( $slugs, $slugs );
}
Related
Uses
| Uses | Description |
|---|---|
| get_post_format_strings() wp-includes/post-formats.php | Returns an array of post format slugs to their translated and pretty display versions |
Used By
| Used By | Description |
|---|---|
| create_initial_theme_features() wp-includes/theme.php | Creates the initial theme features when the ‘setup_theme’ action is fired. |
| WP_REST_Posts_Controller::get_item_schema() wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php | Retrieves the post’s schema, conforming to JSON Schema. |
| add_theme_support() wp-includes/theme.php | Registers theme support for a given feature. |
| set_post_format() wp-includes/post-formats.php | Assign a format to a post |
| _post_format_request() wp-includes/post-formats.php | Filters the request to allow for the format prefix. |
Changelog
| Version | Description |
|---|---|
| 3.1.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_post_format_slugs