php - 从 WooCommerce 生成的产品帖子类型中删除 post_content
问题描述
我正在尝试删除下图中显示的第一个字段,但无法这样做。我已成功删除“产品简短描述”字段,但无法删除该post_content
字段。
我试过的:
add_action('init', 'remove_content');
function remove_content() {
remove_post_type_support('products', 'editor' );
}
解决方案
你可以试试这个:
我认为 woocommerce 使用的帖子类型是product
,您需要的操作是admin_init
add_action('admin_init', 'hide_editor');
function hide_editor() {
remove_post_type_support('product', 'editor');
}
推荐阅读
- javascript - 在 Java 中使用 JavaScript 函数:异常
- node.js - 用nodejs上传文件,multer,react
- python - 在 Python 中将 HEX 字符串转换为 base64
- jenkins - 触发詹金斯管道中的特定构建
- javascript - 首页无限滚动
- php - 每 20 秒调用一次 api - 错误“最大执行时间”
- pine-script - Pine 脚本修改 MACD 买入入场信号
- python - 我只有一个里面有 3 个数据框。我怎样才能连接它们?
- atom-editor - Atom:删除未显示的项目文件夹
- sequelize.js - Sequelize 请求未正确排序记录