Last active
December 23, 2015 09:33
-
-
Save agustinprosperi/fb2440c8d8368a805109 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// add new column(s) to custom taxonomy list | |
add_filter('manage_edit-taconomyName_columns','manage_taconomyName_columns'); | |
function manage_taconomyName_columns($columns){ | |
foreach( $columns as $k=>$v ) | |
$ke = $k; | |
array_pop( $columns ); | |
return array_merge( $columns, | |
array( 'f_image'=>__('Image') ), | |
array( $ke=>$v ) | |
); | |
} | |
add_filter ('manage_taconomyName_custom_column', 'manage_taconomyName_custom_fields', 10,3); | |
function manage_taconomyName_custom_fields($deprecated, $column_name, $term_id){ | |
$prefix = 'cmb2_'; | |
if ($column_name == 'f_image') { | |
$f_image = get_term_meta( $term_id, $prefix.'f_image', true ); | |
echo '<img src="'.$f_image.'" alt="" height="50" />'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment