从 WooCommerce 生成的产品 post 类型中删除 post_content
Remove post_content from WooCommerce generated Products post type
我正在尝试删除下图中显示的第一个字段,但无法删除。我已成功删除“产品简短描述”字段,但无法删除 post_content
字段。
我试过的:
add_action('init', 'remove_content');
function remove_content() {
remove_post_type_support('products', 'editor' );
}
你可以试一试:
我认为 woocommerce 使用的 post 类型是 product
而您需要的操作是 admin_init
add_action('admin_init', 'hide_editor');
function hide_editor() {
remove_post_type_support('product', 'editor');
}
我正在尝试删除下图中显示的第一个字段,但无法删除。我已成功删除“产品简短描述”字段,但无法删除 post_content
字段。
我试过的:
add_action('init', 'remove_content');
function remove_content() {
remove_post_type_support('products', 'editor' );
}
你可以试一试:
我认为 woocommerce 使用的 post 类型是 product
而您需要的操作是 admin_init
add_action('admin_init', 'hide_editor');
function hide_editor() {
remove_post_type_support('product', 'editor');
}