Wordpress 文章编辑页面添加 metabox

 add_meta_box($id,$title,$callback,$screen,$context:,$priority);

参数

  • $id (字符串)(必需)Meta模块的 HTML“ID”属性

  • $title (字符串)(必需)Meta模块的标题,对用户可见

  • $callback (回调)(必需)为Meta模块输出 HTML代码的函数

  • $post_type (字符串)(必需)显示Meta模块的文章类型,可以是文章(post)、页面(page)、链接(link)、附件(attachment) 或 自定义文章类型(自定义文章类型的别名)

  • $context (字符串)(可选)Meta模块的显示位置(’normal’,’advanced’, 或 ‘side’)默认值:’advanced’

  • $priority (字符串)(可选)Meta模块显示的优先级别(’high’, ‘core’, ‘default’or ‘low’)默认值: ‘default’

  • $callback_args (数组)(可选)传递到 callback 函数的参数。callback 函数将接收 $post 对象和其他由这个变量传递的任何参数。

源文件

wp-admin/includes/template.php

Reference
  1. WordPress 添加Meta Box的方法步骤
  2. Plugin API/Action Reference/add meta boxes 案列
  3. add_meta_box() add meta box 的参数
  4. Adding Custom Meta Boxes to the WordPress Admin Interface
  5. How To Create Wordpress Meta Boxes
  6. WordPress中添加Add_Meta_Box使用方法 有add_meta_box()的中文参数说明和案例
  7. WordPress函数:add meta box(自定义添加Meta模块)
posted @ 2019-09-09 19:27  五毛钱的饼  阅读(1051)  评论(0编辑  收藏  举报