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

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -