diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php index 3b038c1163..9913223e3f 100644 --- a/src/wp-includes/post.php +++ b/src/wp-includes/post.php @@ -30,6 +30,7 @@ function create_initial_post_types() { 'capability_type' => 'post', 'map_meta_cap' => true, 'menu_position' => 5, + 'menu_icon' => 'dashicons-admin-post', 'hierarchical' => false, 'rewrite' => false, 'query_var' => false, @@ -54,6 +55,7 @@ function create_initial_post_types() { 'capability_type' => 'page', 'map_meta_cap' => true, 'menu_position' => 20, + 'menu_icon' => 'dashicons-admin-page', 'hierarchical' => true, 'rewrite' => false, 'query_var' => false, @@ -85,6 +87,7 @@ function create_initial_post_types() { 'create_posts' => 'upload_files', ), 'map_meta_cap' => true, + 'menu_icon' => 'dashicons-admin-media', 'hierarchical' => false, 'rewrite' => false, 'query_var' => false, diff --git a/tests/phpunit/tests/post/types.php b/tests/phpunit/tests/post/types.php index 9632b8d472..053f884fc1 100644 --- a/tests/phpunit/tests/post/types.php +++ b/tests/phpunit/tests/post/types.php @@ -263,6 +263,15 @@ class Tests_Post_Types extends WP_UnitTestCase { _unregister_post_type( 'foo' ); } + /** + * @ticket 38844 + */ + public function test_get_post_type_object_includes_menu_icon_for_builtin_post_types() { + $this->assertEquals( 'dashicons-admin-post', get_post_type_object( 'post' )->menu_icon ); + $this->assertEquals( 'dashicons-admin-page', get_post_type_object( 'page' )->menu_icon ); + $this->assertEquals( 'dashicons-admin-media', get_post_type_object( 'attachment' )->menu_icon ); + } + /** * @ticket 14761 */