register_meta()注册一个自定义附加信息的Meta键

目录

描述

Registers meta key. This is for use with WordPress's various APIs as well as the custom post fields box. If you want to create custom UI, you will need to use add_meta_box.

register_meta() 描述

用法

register_meta() 用法

参数

$meta_type

(string) (必填) Type of meta.

默认值: None

$meta_key

(string) (必填) The meta field key.

默认值: None

$sanitize_callback

(mixed) (必填) String or Array. A function to sanitize the meta with a function.

默认值: None

$auth_callback

(mixed) (可选) String or Array. A function or method to call when performing edit_post_meta, add_post_meta, and delete_post_meta capability checks.

默认值: null

register_meta() 参数

示例

Default Usage

register_meta() 示例

相关