Custom taxonomy only gets saved in quick edit

Question

I am having a bit of a problem with my custom taxonomies.

I have set up 2 custom taxonomies for my posts: verdicts and sponsors.

The problem is that sponsors does not get saved when publishing a post, it can only get saved when I check it in quick edit mode.

The code for may custom taxonomy is pretty basic, as you can see below.

Does anyone have any idea?
Thanks!

<?php 
// Register Custom Taxonomy
function custom_sponsors() {

    $labels = array(
        'name'                       => _x( 'Sponsors', 'Taxonomy General Name', 'text_domain' ),
        'singular_name'              => _x( 'Sponsor', 'Taxonomy Singular Name', 'text_domain' ),
        'menu_name'                  => __( 'Sponsors', 'text_domain' ),
        'all_items'                  => __( 'All Sponsors', 'text_domain' ),
        'parent_item'                => __( 'Parent', 'text_domain' ),
        'parent_item_colon'          => __( 'Item:', 'text_domain' ),
        'new_item_name'              => __( 'New Sponsor', 'text_domain' ),
        'add_new_item'               => __( 'Add New Sponsor', 'text_domain' ),
        'edit_item'                  => __( 'Edit Sponsor', 'text_domain' ),
        'update_item'                => __( 'Update Sponsor', 'text_domain' ),
        'separate_items_with_commas' => __( 'Sepprate by comma', 'text_domain' ),
        'search_items'               => __( 'Search', 'text_domain' ),
        'add_or_remove_items'        => __( 'Add or delete', 'text_domain' ),
        'choose_from_most_used'      => __( 'Add most used', 'text_domain' ),
        'not_found'                  => __( 'Not Found', 'text_domain' ),
    );
    $rewrite = array(
        'slug'                       => 'sponsor',
        'with_front'                 => true,
        'hierarchical'               => true,
    );
    $args2 = array(
        'labels'                     => $labels,
        'hierarchical'               => true,
        'public'                     => true,
        'show_ui'                    => true,
        'show_admin_column'          => true,
        'show_in_nav_menus'          => true,
        'show_tagcloud'              => false,
        'query_var'                  => 'sponsor',
        'rewrite'                    => $rewrite,
    );
    register_taxonomy( 'sponsor', array( 'post' ), $args2 );

}

// Hook into the 'init' action
add_action( 'init', 'custom_sponsors', 0 );

?>
0
Adrian Rafail 2 months 0 Answers 11 views 0

Leave an answer