您的当前位置:首页 > 知识博客 > wordpress建站

WordPress自定义文章类型删除编辑区功能函数:remove_post_type_support

时间:2024-03-13

WordPress函数remove_post_type_support用于删除自定义文章类型编辑区功能。

remove_post_type_support( string $post_type, string $feature )

函数参数

$post_type

字符串

自定义文章类型

$feature

字符串或数组

需要删除的功能,例如:title、editor、comments、revisions、trackbacks、author、excerpt、page-attributes、thumbnail、custom-fields、and post-formats

函数使用示例

删除文章编辑区的摘要功能:

function wprocs_custom_init() {
    remove_post_type_support( 'post', 'excerpt' );
}
add_action( 'init', 'wpdocs_custom_init' );

扩展阅读

remove_post_type_support()函数位于:wp-includes/post.php

相关函数:

  • post_type_supports()

  • add_post_type_support()


欢迎咨询/Welcome to inquire
tel/vx:18842938855
qq:1685522781
email:1685522781@qq.com

Copyright © 2019-2024 58.bj.cn


Whatsapp
Powered by RRZCMS