Make WordPress Core


Ignore:
Timestamp:
02/05/2020 10:38:11 PM (5 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/post/types.php

    r47186 r47196  
    265265
    266266    /**
     267     * @ticket 38844
     268     */
     269    public function test_get_post_type_object_includes_menu_icon_for_builtin_post_types() {
     270        $this->assertEquals( 'dashicons-admin-post', get_post_type_object( 'post' )->menu_icon );
     271        $this->assertEquals( 'dashicons-admin-page', get_post_type_object( 'page' )->menu_icon );
     272        $this->assertEquals( 'dashicons-admin-media', get_post_type_object( 'attachment' )->menu_icon );
     273    }
     274
     275    /**
    267276     * @ticket 14761
    268277     */
Note: See TracChangeset for help on using the changeset viewer.