Fix for undefined index plugin errors
-
// Create our drop-down category listing, using all the latest & greatest WordPress things
function tc_ctf_restrict_manage_posts() {global $wp_query;
$filters = tc_ctf_get_filters();
foreach( $filters as $tax_slug ) {
$taxonomy = get_taxonomy( $tax_slug );
$value = array_key_exists($tax_slug, $wp_query->query_vars) ? $wp_query->query_vars[$tax_slug] : ”;
$term = get_term_by( ‘slug’, $value, $taxonomy->name );
$term_id = $term ? $term->term_id : ”;
wp_dropdown_categories(
array(
‘show_option_all’ => __(“Show All ” . $taxonomy->labels->name ),
‘taxonomy’ => $tax_slug,
‘name’ => $tax_slug,
‘hide_empty’ => false,
‘orderby’ => ‘name’,
‘order’ => ‘ASC’,
‘selected’ => $term_id
)
);
}
}
- The topic ‘Fix for undefined index plugin errors’ is closed to new replies.