forked from WordPress/gutenberg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Post formats: Make title and description human readable (WordPress#69275
) * Post formats: Make title and description human readable Co-authored-by: carolinan <[email protected]> Co-authored-by: t-hamano <[email protected]> Co-authored-by: Mamaduka <[email protected]>
- Loading branch information
1 parent
cca7615
commit b06588e
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
/** | ||
* Make the title and description of the post format templates human readable. | ||
* | ||
* @param array $default_template_types Default template types. | ||
* @return array Filtered template type data. | ||
*/ | ||
function gutenberg_post_format_template_title_description( $default_template_types ) { | ||
$post_formats = get_post_format_strings(); | ||
|
||
foreach ( $post_formats as $post_format_slug => $post_format_name ) { | ||
$default_template_types[ 'taxonomy-post_format-post-format-' . $post_format_slug ] = array( | ||
'title' => sprintf( | ||
/* translators: %s: Post format name. */ | ||
_x( 'Post Format: %s', 'Template name' ), | ||
$post_format_name | ||
), | ||
'description' => sprintf( | ||
/* translators: %s: Post format name. */ | ||
__( 'Displays the %s post format archive.' ), | ||
$post_format_name | ||
), | ||
); | ||
} | ||
return $default_template_types; | ||
} | ||
|
||
add_filter( 'default_template_types', 'gutenberg_post_format_template_title_description', 10, 1 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters