Skip to content

Commit 980761f

Browse files
committed
Use Friends plugin post format labels
1 parent 450ee50 commit 980761f

1 file changed

Lines changed: 16 additions & 7 deletions

File tree

includes/adapters/class-friends.php

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -176,19 +176,28 @@ public function get_channels( $channels, $user_id ) {
176176
}
177177

178178
/**
179-
* Get all post formats as channels.
180-
*
181-
* Uses WordPress core get_post_format_strings() and adds 'standard'.
179+
* Get post formats supported by Friends plugin.
182180
*
183181
* @return array Associative array of format slug => format name.
184182
*/
185183
protected function get_post_formats() {
186-
$formats = array( 'standard' => \__( 'Standard', 'microsub' ) );
184+
$friends = $this->get_friends();
187185

188-
// Get formats from WordPress core.
189-
$wp_formats = \get_post_format_strings();
186+
// Use Friends' plural strings for format names.
187+
$formats = array(
188+
'standard' => $friends ? $friends->get_post_format_plural_string( 'standard', 0 ) : \__( 'Posts', 'microsub' ),
189+
'status' => $friends ? $friends->get_post_format_plural_string( 'status', 0 ) : \__( 'Statuses', 'microsub' ),
190+
'image' => $friends ? $friends->get_post_format_plural_string( 'image', 0 ) : \__( 'Images', 'microsub' ),
191+
'video' => $friends ? $friends->get_post_format_plural_string( 'video', 0 ) : \__( 'Videos', 'microsub' ),
192+
'audio' => $friends ? $friends->get_post_format_plural_string( 'audio', 0 ) : \__( 'Audio', 'microsub' ),
193+
'link' => $friends ? $friends->get_post_format_plural_string( 'link', 0 ) : \__( 'Links', 'microsub' ),
194+
'quote' => $friends ? $friends->get_post_format_plural_string( 'quote', 0 ) : \__( 'Quotes', 'microsub' ),
195+
'gallery' => $friends ? $friends->get_post_format_plural_string( 'gallery', 0 ) : \__( 'Galleries', 'microsub' ),
196+
'aside' => $friends ? $friends->get_post_format_plural_string( 'aside', 0 ) : \__( 'Asides', 'microsub' ),
197+
'chat' => $friends ? $friends->get_post_format_plural_string( 'chat', 0 ) : \__( 'Chats', 'microsub' ),
198+
);
190199

191-
return \array_merge( $formats, $wp_formats );
200+
return $formats;
192201
}
193202

194203
/**

0 commit comments

Comments
 (0)