diff --git a/modules/calendar/calendar.php b/modules/calendar/calendar.php index 9a77b643..3dd68503 100644 --- a/modules/calendar/calendar.php +++ b/modules/calendar/calendar.php @@ -1102,12 +1102,6 @@ public function get_editable_html( $type, $value ) { case 'taxonomy': return ''; break; - case 'taxonomy hierarchical': - return wp_dropdown_categories( array( - 'echo' => 0, - 'hide_empty' => 0, - ) ); - break; } } @@ -1181,27 +1175,28 @@ public function get_post_information_fields( $post ) { } else { $value = ''; } - //Used when editing editorial metadata and post meta - if ( is_taxonomy_hierarchical( $taxonomy->name ) ) { - $type = 'taxonomy hierarchical'; - } else { - $type = 'taxonomy'; - } - $information_fields[ $key ] = array( 'label' => $taxonomy->label, 'value' => $value, - 'type' => $type, ); - if ( 'page' == $post->post_type ) { - $ed_cap = 'edit_page'; + // Only allow non-hierarchical taxonomies to be edited in the calendar. + // Hierarchical taxonomies (like categories) cause performance issues and + // the single-select UI removes all but one category when saved. + if ( is_taxonomy_hierarchical( $taxonomy->name ) ) { + $information_fields[ $key ]['type'] = 'taxonomy hierarchical'; } else { - $ed_cap = 'edit_post'; - } + $information_fields[ $key ]['type'] = 'taxonomy'; - if ( current_user_can( $ed_cap, $post->ID ) ) { - $information_fields[ $key ]['editable'] = true; + if ( 'page' == $post->post_type ) { + $ed_cap = 'edit_page'; + } else { + $ed_cap = 'edit_post'; + } + + if ( current_user_can( $ed_cap, $post->ID ) ) { + $information_fields[ $key ]['editable'] = true; + } } } @@ -1698,7 +1693,6 @@ public function handle_ajax_update_metadata() { } else { switch ( $_POST['metadata_type'] ) { case 'taxonomy': - case 'taxonomy hierarchical': $response = wp_set_post_terms( $post->ID, $incoming_metadata_value, $metadata_term ); break; default: