你如何使Wordpress插件具有;每篇文章;选择?

你如何使Wordpress插件具有;每篇文章;选择?,wordpress,wordpress-theming,Wordpress,Wordpress Theming,我正在建立一个Wordpress博客,它需要一个自定义的幻灯片系统,每个post admin页面上都有一个管理面板(有点像Yoast的SEO插件在每个页面上都有选项) 我如何使管理员选项出现在post admin页面上 谢谢 Charlie您没有提供有关项目的详细信息,但您可能需要将数据保存到 下面是一个截断的示例。一些函数的细节对于您的问题并不重要,但它说明了一般的“如何”。按照链接工作,但真诚的测试代码 // author checkboxes add_action( 'add_meta_b

我正在建立一个Wordpress博客,它需要一个自定义的幻灯片系统,每个post admin页面上都有一个管理面板(有点像Yoast的SEO插件在每个页面上都有选项)

我如何使管理员选项出现在post admin页面上

谢谢


Charlie

您没有提供有关项目的详细信息,但您可能需要将数据保存到

下面是一个截断的示例。一些函数的细节对于您的问题并不重要,但它说明了一般的“如何”。按照链接工作,但真诚的测试代码

// author checkboxes
add_action( 'add_meta_boxes', 'assisting_editor' );
function assisting_editor() {
    add_meta_box(
        'assisting_editor', // id, used as the html id att
        __( 'Editorial Tasks' ), // meta box title
        'editor_tasks', // callback function, spits out the content
        'post', // post type or page. This adds to posts only
        'side', // context, where on the screen
        'low' // priority, where should this go in the context
    );
}

// this is the callback that creates the meta box content
function editor_tasks( $post ) {
  // function details skipped; follow the link
}

// to save the data
add_action( 'save_post', 'save_metadata');
// callback for the save hook ^^
function save_metadata($postid) {
  // function details skipped; follow the link
}