mirror of
https://github.com/10h30/display-featured-image-genesis.git
synced 2026-07-11 18:46:03 +09:00
Update taxonomy list
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
<?php
|
||||
|
||||
$args = array(
|
||||
'public' => 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(
|
||||
|
||||
Reference in New Issue
Block a user