johnbillion / extended-cpts

A library which provides extended functionality to WordPress custom post types and taxonomies.
GNU General Public License v2.0
979 stars 96 forks source link

Take menu_name value defined in register_extended_post_type() #170

Closed epigeyre closed 3 years ago

epigeyre commented 3 years ago

Add the ability to defined the menu_name value in the register_extended_post_type() second array of arguments.

johnbillion commented 3 years ago

Thanks for the PR @epigeyre but how is this different from providing the menu_name label in the labels argument? I don't see any advantage to treating this one label differently from the others so I'll close this off. If you have a specific reason this should be in the names array then let me know.

epigeyre commented 3 years ago

Well it's been a while but from what I remember I could not find a way to only specify the admin_menu label (like you can for the slug for exemple). Which means that if I want to specify an admin_menu label directly in the register_extended_post_type function I have to define all the labels.

johnbillion commented 3 years ago

In Extended CPTs you don't need to specify all the labels, it will merge them with the defaults. Example:

register_extended_post_type(
    'article',
    array(
        'labels' => array(
            'menu_name' => 'Stories',
        ),
    )
);

I'll check the documentation to make sure this is clear.