首页 文章

Wordpress / ACF字段作为管理列

提问于
浏览
0

我创建了一个名为'cislo_ponuky'的acf字段 . 这是数字 .

我现在需要的是将它显示为一个名为Nehnutelnosti的自定义帖子类型的管理列,拥有一个'nehnutelnosti' .

add_action( 'manage_nehnutelnosti_custom_column' , 'custom_mycpt_column', 10, 2 );

function custom_mycpt_column($ column,$ post_id){switch($ column){

// display the value of an ACF (Advanced Custom Fields) field
case 'acf_field' :
  echo get_field( 'cislo_ponuky', $post_id );  
  break;

}}

不幸的是,这段代码对我不起作用 .

1 回答

相关问题