Home Can not delete or edit categories - Wordpress
Reply: 0

Can not delete or edit categories - Wordpress

user3126
1#
user3126 Published in May 27, 2018, 3:31 am

we have detected a strange bug with our wordpress-system. We have created custom categories for one custom post type. In the backend the categories are not editable or deletable. Does someone had this issue before?

No special Plugins were installed and nothing special were done before...

Hope you guys can help out! Thank you!

Custom Post Type Code (we have already tried to solve it with the capabilities which won't work at all)

function bm_custom_post_type()
{

    $labels = array(
        'name'               => __( 'Anwälte' ),
        'singular_name'      => __( 'Anwalt' ),
        'add_new'            => __( 'Anwalt hinzufügen' ),
        'add_new_item'       => __( 'Anwalt hinzufügen' ),
        'edit_item'          => __( 'Anwalt bearbeiten' ),
        'new_item'           => __( 'Anwalt hinzufügen' ),
        'view_item'          => __( 'Anwalt ansehen' ),
        'search_items'       => __( 'Anwalt durchsuchen' ),
        'not_found'          => __( 'Keinen Anwalt gefunden...' ),
        'not_found_in_trash' => __( 'Keinen Anwalt im Papierkorb gefunden.' ),
        'parent_item_colon'  => ''
    );

    $fields = array(
        'labels'             => $labels,
        'public'             => true,
        'publicly_queryable' => true,
        'show_ui'            => true,
        'query_var'          => true,
        'capability_type'    => 'post',
        'menu_icon'          => 'dashicons-businessman',
        'hierarchical'       => false,
        'menu_position'      => null,
        'rewrite'            => array( 'slug' => 'anwaelte' ),
        'supports'           => array( 'title', 'editor', 'thumbnail', 'page-attributes', 'revisions' )
    );

    register_post_type('anwaelte', $fields);

    register_taxonomy(
        'expertise',
        array( 'anwaelte', 'page' ),
        array(
        'capabilities' => array(
        'manage_terms' => 'manage_categories',
        'edit_terms' => 'manage_categories',
        'delete_terms' => 'manage_categories',
        'assign_terms' => 'edit_posts'
        ),

        'label' => __( 'Expertise' ),

            'hierarchical' => true,

        'rewrite' => array('slug' => 'tax-expertise'),
        'show_ui' => true,
        'show_admin_column' => true,
        'query_var' => true,
        )
    );

    register_taxonomy(
        'rechtsgebiete',
        array( 'anwaelte' ),
        array(
        'capabilities' => array(
        'manage_terms' => 'manage_categories',
        'edit_terms' => 'manage_categories',
        'delete_terms' => 'manage_categories',
        'assign_terms' => 'edit_posts'
        ),
            'hierarchical' => true,
            'label' => __( 'Rechtsgebiete' ),
        'rewrite' => array('slug' => 'tax-rechtsgebiete'),
        'show_ui' => true,
        'show_admin_column' => true,
        'query_var' => true,
        )
    );
}
add_action('init', 'bm_custom_post_type');
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.310118 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO