diff --git src/wp-includes/post.php src/wp-includes/post.php
index 9e20aa0..98e01fe 100644
|
|
function register_post_status( $post_status, $args = array() ) { |
815 | 815 | $args->label = $post_status; |
816 | 816 | |
817 | 817 | if ( false === $args->label_count ) |
818 | | $args->label_count = array( $args->label, $args->label ); |
| 818 | $args->label_count = _n_noop( $args->label, $args->label ); |
819 | 819 | |
820 | 820 | $wp_post_statuses[$post_status] = $args; |
821 | 821 | |
diff --git tests/phpunit/tests/admin/includesListTable.php tests/phpunit/tests/admin/includesListTable.php
index 39a0b97..1c8352b 100644
|
|
class Tests_Admin_includesListTable extends WP_UnitTestCase { |
237 | 237 | |
238 | 238 | $this->assertNotContains( 'id="cat"', $output ); |
239 | 239 | } |
| 240 | |
| 241 | /** |
| 242 | * @ticket 38686 |
| 243 | */ |
| 244 | function test_label_count_fallback_no_notices() { |
| 245 | create_initial_post_types(); |
| 246 | register_post_status( 'foo', [ |
| 247 | 'label' => 'Foo', |
| 248 | 'show_in_admin_status_list' => true, |
| 249 | ] ); |
| 250 | |
| 251 | $p = self::factory()->post->create_and_get( array( |
| 252 | 'post_type' => 'post', |
| 253 | 'post_status' => 'foo' |
| 254 | ) ); |
| 255 | |
| 256 | $this->table->screen->post_status = 'foo'; |
| 257 | |
| 258 | ob_start(); |
| 259 | $this->table->get_views(); |
| 260 | $output = ob_get_clean(); |
| 261 | |
| 262 | $this->assertNotContains( 'Undefined index', $output ); |
| 263 | } |
240 | 264 | } |