php - Wordpress / ACF field as an admin column -
i've created acf field named 'cislo_ponuky'. it's numeric.
what need display admin column in custom post type called nehnutelnosti owning slug of 'nehnutelnosti'.
add_action( 'manage_nehnutelnosti_custom_column' , 'custom_mycpt_column', 10, 2 );
function custom_mycpt_column( $column, $post_id ) { switch ( $column ) {
// display value of acf (advanced custom fields) field case 'acf_field' : echo get_field( 'cislo_ponuky', $post_id ); break;
} }
this code's not working me unfortunately.
you can use "codepress-admin-columns" plugin admin column https://wordpress.org/plugins/codepress-admin-columns/
Comments
Post a Comment