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, 'save_taxonomy_custom_meta' ), 10, 2 );
add_action( "create_{$taxonomy}", array( $this, 'save_taxonomy_custom_meta' ), 10, 2 );
}
}
function add_columns_post_types() {
$args = array(
'public' => true,
'_builtin' => false,
);
$output = 'names';
$post_types = get_post_types( $args, $output );
$post_types['post'] = 'post';
$post_types['page'] = 'page';
foreach ( $post_types as $post_type ) {
add_filter( "manage_{$post_type}_posts_columns", array( $this, 'add_post_columns' ) );
add_action( "manage_{$post_type}_posts_custom_column", array( $this, 'custom_post_columns' ), 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 '