0

How I can register one (or more) custom taxonomy listed under "Pages" in the wp-admin menu but to be usable on the all other (registered) custom post types?

Here is code what I use:

register_taxonomy( 'ortsgruppe', NULL,  array(
    'labels'            => array(
        'name'              => __( 'Ortsgruppe', 'mitdabei' ),
        'singular_name'     => __( 'Ortsgruppe', 'mitdabei' ),
        'search_items'      => __( 'Search Ortsgruppes', 'mitdabei' ),
        'all_items'         => __( 'All Ortsgruppes', 'mitdabei' ),
        'edit_item'         => __( 'Edit Ortsgruppe', 'mitdabei' ),
        'update_item'       => __( 'Update Ortsgruppe', 'mitdabei' ),
        'add_new_item'      => __( 'Add New Ortsgruppe', 'mitdabei' ),
        'new_item_name'     => __( 'New Ortsgruppe Name', 'mitdabei' ),
        'menu_name'         => __( 'Ortsgruppe', 'mitdabei' ),
        'separate_items_with_commas'=> __( 'Separate Ortsgruppes with commas', 'mitdabei' ),
        'choose_from_most_used'=> __( 'Choose from the most used Ortsgruppes', 'mitdabei' ),
    ),
    'show_ui'           => true,
    'show_admin_column' => true,
    'query_var'         => true,
    'hierarchical'      => true,
    'capabilities' => array(
        'manage_terms'  =>   'manage_ortsgruppe',
        'edit_terms'    =>   'edit_ortsgruppe',
        'delete_terms'  =>   'delete_ortsgruppe',
        'assign_terms'  =>   'assign_ortsgruppe'
    )
));

register_taxonomy_for_object_type( 'ortsgruppe', 'page' );
register_taxonomy_for_object_type( 'ortsgruppe', 'travel' );
register_taxonomy_for_object_type( 'ortsgruppe', 'team' );
register_taxonomy_for_object_type( 'ortsgruppe', 'dabei-gsi' );
register_taxonomy_for_object_type( 'ortsgruppe', 'post' );
register_taxonomy_for_object_type( 'ortsgruppe', 'homepage-slider' );
register_taxonomy_for_object_type( 'ortsgruppe', 'organisation' );

This code show custom taxonomy under all defined post types but Ionly want to be listed under pages and oher post types to use it in the add/edit pages.

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.