【问题标题】:Wordpress / ACF field as an admin columnWordpress / ACF 字段作为管理列
【发布时间】:2017-12-31 07:49:16
【问题描述】:

我创建了一个名为“cislo_ponuky”的 acf 字段。是数字。

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

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

函数 custom_mycpt_column( $column, $post_id ) { 开关 ( $column ) {

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

} }

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

【问题讨论】:

    标签: php wordpress field advanced-custom-fields


    【解决方案1】:

    您可以使用“codepress-admin-columns”插件作为管理列https://wordpress.org/plugins/codepress-admin-columns/

    【讨论】:

    • 不,我不能尝试'。仅在高级版本中允许使用 ACF。我需要一个免费的解决方案。
    猜你喜欢
    • 1970-01-01
    • 2014-12-23
    • 2019-03-30
    • 2019-07-19
    • 2023-03-15
    • 2017-06-20
    • 2017-02-02
    • 2017-02-01
    • 1970-01-01
    相关资源
    最近更新 更多