settings = new Display_Featured_Image_Genesis_Settings(); $args = array( 'public' => true, ); $output = 'names'; $taxonomies = get_taxonomies( $args, $output ); foreach ( $taxonomies as $taxonomy ) { add_action( "{$taxonomy}_add_form_fields", array( $this, 'add_taxonomy_meta_fields' ), 5, 2 ); add_action( "{$taxonomy}_edit_form_fields", array( $this, 'edit_taxonomy_meta_fields' ), 5, 2 ); add_action( "edited_{$taxonomy}", array( $this->settings, 'save_taxonomy_custom_meta' ), 10, 2 ); add_action( "create_{$taxonomy}", array( $this->settings, 'save_taxonomy_custom_meta' ), 10, 2 ); add_action( 'load-edit-tags.php', array( $this, 'help' ) ); } } /** * add featured image uploader to new term add */ public function add_taxonomy_meta_fields() { echo '
'; printf( __( 'Set Featured Image for new term.', 'display-featured-image-genesis' ) ); echo '
'; echo ''; printf( __( 'Set Featured Image for %1$s.', 'display-featured-image-genesis' ), esc_attr( $term->name ) ); echo '
'; echo '' . __( 'You may set a featured image for your terms. This image will be used on the term archive page, and as a fallback image on a single post page if it does not have a featured image of its own.', 'display-featured-image-genesis' ) . '
'; $screen->add_help_tab( array( 'id' => 'displayfeaturedimage_term-help', 'title' => __( 'Featured Image', 'display-featured-image-genesis' ), 'content' => $term_help, ) ); } }