diff --git wp-includes/post-formats.php wp-includes/post-formats.php
index 7800ba0..94c5581 100644
|
|
function set_post_format( $post, $format ) { |
79 | 79 | } |
80 | 80 | |
81 | 81 | /** |
82 | | * Returns an array of post format slugs to their translated and pretty display versions |
| 82 | * Returns an array of post format slugs to their translated and pretty display versions. |
83 | 83 | * |
84 | 84 | * @since 3.1.0 |
| 85 | * @since 4.4.0 Added the `$plural` parameter. |
85 | 86 | * |
| 87 | * @param $plural bool Set to true to return the plural versions of the strings. |
86 | 88 | * @return array The array of translated post format names. |
87 | 89 | */ |
88 | | function get_post_format_strings() { |
89 | | $strings = array( |
| 90 | function get_post_format_strings( $plural = false ) { |
| 91 | $singular_strings = array( |
90 | 92 | 'standard' => _x( 'Standard', 'Post format' ), // Special case. any value that evals to false will be considered standard |
91 | 93 | 'aside' => _x( 'Aside', 'Post format' ), |
92 | 94 | 'chat' => _x( 'Chat', 'Post format' ), |
… |
… |
function get_post_format_strings() { |
98 | 100 | 'video' => _x( 'Video', 'Post format' ), |
99 | 101 | 'audio' => _x( 'Audio', 'Post format' ), |
100 | 102 | ); |
101 | | return $strings; |
| 103 | |
| 104 | $plural_strings = array( |
| 105 | 'standard' => _x( 'Standard posts', 'Post format (plural)' ), |
| 106 | 'aside' => _x( 'Asides', 'Post format (plural)' ), |
| 107 | 'chat' => _x( 'Chats', 'Post format (plural)' ), |
| 108 | 'gallery' => _x( 'Galleries', 'Post format (plural)' ), |
| 109 | 'link' => _x( 'Links', 'Post format (plural)' ), |
| 110 | 'image' => _x( 'Images', 'Post format (plural)' ), |
| 111 | 'quote' => _x( 'Quotes', 'Post format (plural)' ), |
| 112 | 'status' => _x( 'Statuses', 'Post format (plural)' ), |
| 113 | 'video' => _x( 'Videos', 'Post format (plural)' ), |
| 114 | 'audio' => _x( 'Audio', 'Post format (plural)' ), |
| 115 | ); |
| 116 | |
| 117 | if ( $plural ) { |
| 118 | return $plural_strings; |
| 119 | } else { |
| 120 | return $singular_strings; |
| 121 | } |
102 | 122 | } |
103 | 123 | |
104 | 124 | /** |
… |
… |
function get_post_format_slugs() { |
117 | 137 | * Returns a pretty, translated version of a post format slug |
118 | 138 | * |
119 | 139 | * @since 3.1.0 |
| 140 | * @since 4.4.0 Added the `$plural` parameter. |
120 | 141 | * |
121 | | * @param string $slug A post format slug. |
| 142 | * @param string $slug A post format slug. |
| 143 | * @param bool $plural The singular or plural version of the strings. |
122 | 144 | * @return string The translated post format name. |
123 | 145 | */ |
124 | | function get_post_format_string( $slug ) { |
125 | | $strings = get_post_format_strings(); |
| 146 | function get_post_format_string( $slug, $plural = false ) { |
| 147 | $strings = get_post_format_strings( $plural ); |
126 | 148 | if ( !$slug ) |
127 | 149 | return $strings['standard']; |
128 | 150 | else |