Skip to content

Commit 1998c91

Browse files
refactor: post status label
1 parent c4dfa53 commit 1998c91

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

includes/admin/feedzy-rss-feeds-import.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -446,10 +446,7 @@ public function feedzy_import_feed_options() {
446446
'feedzy_categories' => array(),
447447
)
448448
);
449-
$published_status = array(
450-
'publish' => __( 'Publish', 'feedzy-rss-feeds' ),
451-
'draft' => __( 'Draft', 'feedzy-rss-feeds' ),
452-
);
449+
$published_status = array( 'publish', 'draft' );
453450

454451
$authors = get_users( array( 'number' => 100 ) );
455452
$authors_array = array();

includes/layouts/setup-wizard.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@
2222
$wizard_data = get_option( 'feedzy_wizard_data', array() );
2323
$feed_source = ! empty( $wizard_data['feed'] ) ? $wizard_data['feed'] : '';
2424
}
25-
$published_status = array(
26-
'publish' => __( 'Publish', 'feedzy-rss-feeds' ),
27-
'draft' => __( 'Draft', 'feedzy-rss-feeds' ),
28-
);
25+
$published_status = array( 'publish', 'draft' );
2926

3027
add_thickbox();
3128
?>
@@ -195,7 +192,8 @@
195192
<div class="mx-320">
196193
<select id="feedzy_post_status" class="form-control feedzy-chosen" name="feedzy_meta_data[import_post_status]">
197194
<?php
198-
foreach ( $published_status as $_status => $_label ) {
195+
foreach ( $published_status as $_status ) {
196+
$_label = get_post_status_object( $_status )->label;
199197
?>
200198
<option value="<?php echo esc_attr( $_status ); ?>">
201199
<?php echo esc_html( $_label ); ?>

includes/views/import-metabox-edit.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@ class="dashicons dashicons-arrow-down-alt2"></span>
225225
<div class="mx-320">
226226
<select id="feedzy_post_status" class="form-control feedzy-chosen" name="feedzy_meta_data[import_post_status]">
227227
<?php
228-
foreach ( $published_status as $_status => $_label ) {
228+
foreach ( $published_status as $_status ) {
229+
$_label = get_post_status_object( $_status )->label;
229230
?>
230231
<option value="<?php echo esc_attr( $_status ); ?>" <?php selected( $import_post_status, $_status ); ?>>
231232
<?php echo esc_html( $_label ); ?></option>

0 commit comments

Comments
 (0)