【问题标题】:Remove post_content from WooCommerce generated Products post type从 WooCommerce 生成的产品帖子类型中删除 post_content
【发布时间】:2021-01-23 16:41:08
【问题描述】:

我正在尝试删除下图中显示的第一个字段,但无法这样做。我已成功删除“产品简短描述”字段,但无法删除 post_content 字段。

我的尝试:

add_action('init', 'remove_content');
function remove_content() {
  remove_post_type_support('products', 'editor' );
}

【问题讨论】:

    标签: php wordpress custom-post-type


    【解决方案1】:

    你可以试试这个:

    我认为woocommerce使用的帖子类型是product,您需要的操作是admin_init

    add_action('admin_init', 'hide_editor');
            
    function hide_editor() {
      remove_post_type_support('product', 'editor');
    }
    

    【讨论】:

      猜你喜欢
      • 2016-09-28
      • 1970-01-01
      • 2016-12-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-04-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多