On this page
get_post_format_string( string $slug ): string
Returns a pretty, translated version of a post format slug
Parameters
$slugstring Required-
A post format slug.
Return
string The translated post format name.
Source
File: wp-includes/post-formats.php. View all references
function get_post_format_string( $slug ) {
$strings = get_post_format_strings();
if ( ! $slug ) {
return $strings['standard'];
} else {
return ( isset( $strings[ $slug ] ) ) ? $strings[ $slug ] : '';
}
}
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 |
|---|---|
| WP_REST_Post_Format_Search_Handler::search_items() wp-includes/rest-api/search/class-wp-rest-post-format-search-handler.php | Searches the object type content for a given search request. |
| WP_REST_Post_Format_Search_Handler::prepare_item() wp-includes/rest-api/search/class-wp-rest-post-format-search-handler.php | Prepares the search result for a given ID. |
| WP_Posts_List_Table::formats_dropdown() wp-admin/includes/class-wp-posts-list-table.php | Displays a formats drop-down for filtering items. |
| post_format_meta_box() wp-admin/includes/meta-boxes.php | Displays post format form elements. |
| WP_Posts_List_Table::inline_edit() wp-admin/includes/class-wp-posts-list-table.php | Outputs the hidden row displayed when inline editing |
| _post_format_get_term() wp-includes/post-formats.php | Remove the post format prefix from the name property of the term object created by get_term() . |
| _post_format_get_terms() wp-includes/post-formats.php | Remove the post format prefix from the name property of the term objects created by get_terms() . |
| _post_format_wp_get_object_terms() wp-includes/post-formats.php | Remove the post format prefix from the name property of the term objects created by wp_get_object_terms() . |
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_string