Created
January 23, 2019 09:53
-
-
Save alanef/5a28b345f8450b1ade6453e2747d1364 to your computer and use it in GitHub Desktop.
Change menu location and title of registered post type menu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'register_post_type_args', function ( $args, $post_type ) { | |
| if ( $post_type == "sub" ) { | |
| $args['show_in_menu'] = 'edit.php?post_type=top'; | |
| $args['labels']['all_items'] = __( 'All Sub Items', 'my-text-domain' ); | |
| } | |
| return $args; | |
| }, 11, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment