如何在ACF中使用show_in_rest = true?

问题描述 投票:0回答:1

我正在使用带有 ACF 的经典编辑器。
我在使用CFS时描述过

register_post_type(
 "article",
 array(
  "label" => "記事",
  "public" => true,
  "has_archive" => true,
  "show_in_rest" => true,//here!
  "menu_position" => 5,
  "supports" => array (
   "title",
   "editor",
   "revisions",
  ),
 ),
);

我已经尝试过 register_rest_field() 但没有答案。 如何在 ACF 中使用经典编辑器使用 show_in_rest = true?

页面中,显示经典编辑器。
在帖子中,古腾堡编辑展示了。
这正是我所期待的。 我应该创建自定义块吗?

php wordpress advanced-custom-fields wordpress-gutenberg acf-gutenberg
1个回答
0
投票

这只是一个不小心的错误造成的...... 我正在激活插件“经典编辑器”,因此 show_in_rest 被经典编辑器覆盖。 当我停用 Clasicc 编辑器时,它起作用了。 我为我的不足感到抱歉:(

© www.soinside.com 2019 - 2024. All rights reserved.