Posts, Post Types: Add default menu_icon
values for built-in post types.
This allows the icons to be retrieved via `get_post_type_object()`. Props m.usama.masood, michael.ecklund, SergeyBiryukov. Fixes #38844. git-svn-id: https://develop.svn.wordpress.org/trunk@47196 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
56e4630c0e
commit
011962fae0
@ -30,6 +30,7 @@ function create_initial_post_types() {
|
|||||||
'capability_type' => 'post',
|
'capability_type' => 'post',
|
||||||
'map_meta_cap' => true,
|
'map_meta_cap' => true,
|
||||||
'menu_position' => 5,
|
'menu_position' => 5,
|
||||||
|
'menu_icon' => 'dashicons-admin-post',
|
||||||
'hierarchical' => false,
|
'hierarchical' => false,
|
||||||
'rewrite' => false,
|
'rewrite' => false,
|
||||||
'query_var' => false,
|
'query_var' => false,
|
||||||
@ -54,6 +55,7 @@ function create_initial_post_types() {
|
|||||||
'capability_type' => 'page',
|
'capability_type' => 'page',
|
||||||
'map_meta_cap' => true,
|
'map_meta_cap' => true,
|
||||||
'menu_position' => 20,
|
'menu_position' => 20,
|
||||||
|
'menu_icon' => 'dashicons-admin-page',
|
||||||
'hierarchical' => true,
|
'hierarchical' => true,
|
||||||
'rewrite' => false,
|
'rewrite' => false,
|
||||||
'query_var' => false,
|
'query_var' => false,
|
||||||
@ -85,6 +87,7 @@ function create_initial_post_types() {
|
|||||||
'create_posts' => 'upload_files',
|
'create_posts' => 'upload_files',
|
||||||
),
|
),
|
||||||
'map_meta_cap' => true,
|
'map_meta_cap' => true,
|
||||||
|
'menu_icon' => 'dashicons-admin-media',
|
||||||
'hierarchical' => false,
|
'hierarchical' => false,
|
||||||
'rewrite' => false,
|
'rewrite' => false,
|
||||||
'query_var' => false,
|
'query_var' => false,
|
||||||
|
@ -263,6 +263,15 @@ class Tests_Post_Types extends WP_UnitTestCase {
|
|||||||
_unregister_post_type( 'foo' );
|
_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
|
* @ticket 14761
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user