Skip to content

Commit af5e203

Browse files
committed
Supply missing selected attribute on post_status dropdown
1 parent 98b454f commit af5e203

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

customize-posts.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* Plugin Name: Customize Posts
44
* Description: Manage posts and postmeta via the customizer.
5-
* Version: 0.2.0
5+
* Version: 0.2.1
66
* Author: X-Team WP, Weston Ruter
77
* Author URI: http://x-team.com/wordpress/
88
* License: GPLv2+

php/class-wp-post-edit-customize-control.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ static function get_fields( $post ) {
115115
<label for="<?php echo esc_attr( $id ) ?>"><?php esc_html_e( 'Status:', 'customize-posts' ) ?></label>
116116
<select class="post-data post_status" id="<?php echo esc_attr( $id ) ?>" name="<?php echo esc_attr( $id ) ?>">
117117
<?php foreach ( get_post_stati( array( 'internal' => false ) ) as $post_status ): ?>
118-
<option value='<?php echo esc_attr( $post_status ) ?>'><?php echo esc_html( get_post_status_object( $post_status )->label ) ?></option>
118+
<option value="<?php echo esc_attr( $post_status ) ?>" <?php selected( $post_status, $post->post_status ) ?>><?php echo esc_html( get_post_status_object( $post_status )->label ) ?></option>
119119
<?php endforeach; ?>
120120
</select>
121121
</p>

readme.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ This **Customize Posts** plugin is not to be confused with 10up's [**Post Custom
4040

4141
## Changelog ##
4242

43+
### 0.2.1 ###
44+
Supply missing `selected` attribute on `post_status` dropdown.
45+
4346
### 0.2.0 ###
4447
Initial release on WordPress.org. Key new features:
4548

readme.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ This **Customize Posts** plugin is not to be confused with 10up's [**Post Custom
3232

3333
== Changelog ==
3434

35+
= 0.2.1 =
36+
Supply missing `selected` attribute on `post_status` dropdown.
37+
3538
= 0.2.0 =
3639
Initial release on WordPress.org. Key new features:
3740

0 commit comments

Comments
 (0)