remove_post_type_support()删除一个自定义的页面类型

目录

描述

Remove support of certain features for a given post type (s). All features are directly associated with a functional area of the edit screen, such as the editor or a meta box. Additionally, the 'revisions' feature dictates whether the post type will store revisions, and the 'comments' feature dictates whether the comments count will show on the edit screen.

Typically remove_post_type_support() should be attached to the 'init' action hook.

remove_post_type_support() 描述

用法

<?php remove_post_type_support$post_type$supports ?>

remove_post_type_support() 用法

参数

$post_type

(string) (必填) Post type. (max. 20 characters)

默认值: None

$supports

(string) (必填) Feature to remove.

默认值: None

  • 'title'
  • 'editor' (content)
  • 'author'
  • 'thumbnail' (featured image) (current theme must also support Post Thumbnails)
  • 'excerpt'
  • 'trackbacks'
  • 'custom-fields'
  • 'comments' (also will see comment count balloon on edit screen)
  • 'revisions' (will store revisions)
  • 'page-attributes' (template and menu order) (hierarchical must be true)
  • 'post-formats' removes post formats, see Post Formats

remove_post_type_support() 参数

示例

Remove support for excerpts

This example removes support for excerpts in posts:

Remove support for post formats

This example removes support for post formats in posts:

remove_post_type_support() 示例

历史

  • 添加于 版本 3.0

remove_post_type_support() 历史

源文件

remove_post_type_support() 函数的代码位于 wp-includes/post.php.

remove_post_type_support() 源文件

相关