0

I added a custom post type in my navigation menu. with this code

register_post_type(
        'post_type_name', array(
            'exclude_from_search' => false,
            'label'               => 'Name',   
            'menu_position'       => 5,   
            'public'              => true,   
            'publicly_queryable'  => true,   
            'query_var'           => 'name',   
            'show_in_menu'        => false,   
            'show_in_nav_menus'   => true,  
            'supports'            => array( 'editor', 'title' ),
        )
    );

Now I'd like to add some functionality to this custom post type only ( the functionalities are provided by my plugin ) How can I do that?

enter image description here

The new type is already visible but it says "Keine Elemente" - "No elements". How can i add a plugin function to this?

  • you'll need to add posts ( to your custom post type ) in order to see them on menu lists. If you have posts created already then change 'show_in_menu' => false, to 'show_in_menu' => true, – maverick Sep 12 '18 at 7:17
  • Thank you. I think the problem is the "register_post_type". Is there another solution like "add_meta_box"? – Tom Sep 12 '18 at 7:31
  • what exactly do you want to accomplish – maverick Sep 12 '18 at 7:33
  • i would like to either get a selectbox or radio buttons. a multiple selection should not be possible. the chosen option should then output a function from my plugin. The goal is to be able to extend my navigation with my own functions from my plugin – Tom Sep 12 '18 at 7:49
  • that's a lot to answer in comment, you can ask another question ( state what exactly you want to do, what you already did and where you stuck ) – maverick Sep 12 '18 at 8:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.