Php 为什么元框没有出现在WordPress添加新UI中?

Php 为什么元框没有出现在WordPress添加新UI中?,php,wordpress,custom-post-type,Php,Wordpress,Custom Post Type,我的代码如下(我正在工作): 替换此行: add_meta_box( 'series-summary', 'Series Summary', array( $this, 'output_meta_box' ), 'series', // <-- Problem here! 'normal', 'high' ); // $id, $title, $callback, $screen, $context, $priority 与:

我的代码如下(我正在工作):


替换此行:

add_meta_box( 
    'series-summary', 
    'Series Summary', 
    array( $this, 'output_meta_box' ), 
    'series', // <-- Problem here!
    'normal', 
    'high'
); // $id, $title, $callback, $screen, $context, $priority
与:


我知道答案被接受了,但我只想提到CMB2图书馆。我用过它,它很棒,比标准的Wordpress方式简单得多。 我知道其他流行的插件使用它作为代码的基础

可以在GitHub上找到它:

那很容易!我一直在使用Tuts+教程,并在运行中更改为我的CPT,但我错过了那一个。谢谢,我实际上一直在考虑使用CMB2,它看起来确实很棒!
add_meta_box( 
    'series-summary', 
    'Series Summary', 
    array( $this, 'output_meta_box' ), 
    'series', // <-- Problem here!
    'normal', 
    'high'
); // $id, $title, $callback, $screen, $context, $priority
add_meta_box( 
    'series-summary', 
    'Series Summary', 
    array( $this, 'output_meta_box' ), 
    'contact',  //<-- Match it with the post type 
    'normal', 
    'high'
); // $id, $title, $callback, $screen, $context, $priority
 register_post_type( 'contact', array(
 register_post_type( 'series', array(