Hello, I'm attempting to show a Container on a page that has the taxonomy term of "slider" in a custom taxonomy of "layouts". The Container shows up in the DOM but gets hidden by javascript. I think the source is containers.js in the checkVisibility function. On line 668 it checks if termId is in the terms array. However, my terms array is coming up empty for some reason. Here's the code where I make my Container:
// Image slider
Container::make('post_meta', 'Image Slider')
->show_on_post_type('page')
->show_on_taxonomy_term('slider', 'layouts')
->add_fields(array(
Field::make('complex', 'image_slider')->add_fields(array(
Field::make('text', 'title'),
Field::make('text', 'subtitle'),
Field::make('image', 'photo')->set_value_type('url'),
))
));
Do you have any idea what the issue might be? Is there a step I'm missing? Here's the code where I create my custom taxonomy:
$labels = array(
'name' => _x( 'Layouts', 'taxonomy general name' ),
'singular_name' => _x( 'Layout', 'taxonomy singular name' ),
'search_items' => __( 'Search Layouts' ),
'popular_items' => __( 'Popular Layouts' ),
'all_items' => __( 'All Layouts' ),
'parent_item' => null,
'parent_item_colon' => null,
'edit_item' => __( 'Edit Layout' ),
'update_item' => __( 'Update Layout' ),
'add_new_item' => __( 'Add New Layout' ),
'new_item_name' => __( 'New Layout Name' ),
'separate_items_with_commas' => __( 'Separate topics with commas' ),
'add_or_remove_items' => __( 'Add or remove topics' ),
'choose_from_most_used' => __( 'Choose from the most used topics' ),
'menu_name' => __( 'Layouts' ),
);
register_taxonomy('layouts','page',array(
'hierarchical' => false,
'labels' => $labels,
'show_ui' => true,
'show_admin_column' => true,
'update_count_callback' => '_update_post_term_count',
'query_var' => true,
'rewrite' => array( 'slug' => 'layouts' ),
));
wp_set_object_terms( get_option( 'page_on_front' ), 'slider', 'layouts' );