diff --git a/includes/widgets/displayfeaturedimagegenesis-taxonomy-widget.php b/includes/widgets/displayfeaturedimagegenesis-taxonomy-widget.php index 8e4c3ee..c17ec38 100644 --- a/includes/widgets/displayfeaturedimagegenesis-taxonomy-widget.php +++ b/includes/widgets/displayfeaturedimagegenesis-taxonomy-widget.php @@ -154,23 +154,6 @@ class Display_Featured_Image_Genesis_Widget_Taxonomy extends WP_Widget { ) ); } - /** - * @return array - */ - protected function get_taxonomies() { - $args = array( - 'public' => true, - 'show_ui' => true, - ); - $taxonomies = get_taxonomies( $args, 'objects' ); - $options = array(); - foreach ( $taxonomies as $taxonomy ) { - $options[ $taxonomy->name ] = $taxonomy->label; - } - - return $options; - } - /** * @param $instance * @param bool $ajax diff --git a/includes/widgets/fields/term-taxonomy.php b/includes/widgets/fields/term-taxonomy.php index 0c918f8..c06ad1e 100644 --- a/includes/widgets/fields/term-taxonomy.php +++ b/includes/widgets/fields/term-taxonomy.php @@ -1,5 +1,14 @@ true, + 'show_ui' => true, +); +$taxonomies = get_taxonomies( $args, 'objects' ); +$tax_options = array(); +foreach ( $taxonomies as $taxonomy ) { + $tax_options[ $taxonomy->name ] = $taxonomy->label; +} /** * Define term specific taxonomy fields. */ @@ -11,7 +20,7 @@ return array( 'label' => __( 'Taxonomy:', 'display-featured-image-genesis' ), 'flex' => true, 'onchange' => sprintf( 'term_postback(\'%s\', this.value );', esc_attr( $this->get_field_id( 'term' ) ) ), - 'choices' => $this->get_taxonomies(), + 'choices' => $tax_options, ), ), array(