true );
$output = 'objects';
$taxonomies = get_taxonomies( $args, $output );
foreach ( $taxonomies as $taxonomy ) {
add_action( $taxonomy->name . '_add_form_fields', array( $this, 'add_taxonomy_meta_fields' ), 5, 2 );
add_action( $taxonomy->name . '_edit_form_fields', array( $this, 'edit_taxonomy_meta_fields' ), 5, 2 );
add_action( 'edited_' . $taxonomy->name, array( $this, 'save_taxonomy_custom_meta' ), 10, 2 );
add_action( 'create_' . $taxonomy->name, array( $this, 'save_taxonomy_custom_meta' ), 10, 2 );
}
}
function add_taxonomy_meta_fields() {
//* this will add the custom meta field to the add new term page
echo '
';
echo '';
echo '';
echo '';
echo '
' . __( 'Set Featured Image for Taxonomy','display-featured-image-genesis' ) . '
';
echo '
';
}
//* Edit term page
function edit_taxonomy_meta_fields( $term ) {
//* put the term ID into a variable
$t_id = $term->term_id;
//* retrieve the existing value(s) for this meta field. This returns an array
$term_meta = get_option( "taxonomy_$t_id" );
//* this will add the custom meta field to the add new term page
echo '