Php Wordpress函数-向新分类添加插件
我有一个wordpress站点,在仪表板中,我添加了一个新的菜单项-属性,它有一个元字段列表,如位置、价格等 此外,我还想向它添加附件插件,这样每个新的属性都可以为我设置的图像库添加附件。我该怎么做 更多信息,我在我的functions.php中定义了:Php Wordpress函数-向新分类添加插件,php,wordpress,wordpress-theming,Php,Wordpress,Wordpress Theming,我有一个wordpress站点,在仪表板中,我添加了一个新的菜单项-属性,它有一个元字段列表,如位置、价格等 此外,我还想向它添加附件插件,这样每个新的属性都可以为我设置的图像库添加附件。我该怎么做 更多信息,我在我的functions.php中定义了: $property->add_meta_box( 'Property Info', array( array( 'name' => 'price',
$property->add_meta_box(
'Property Info',
array(
array(
'name' => 'price',
'label' => 'Price',
'description' => 'Leave Blank for TBC',
'type' => 'text'
),
array(
'name' => 'bedrooms',
'label' => 'Bedrooms',
'type' => 'text'
),
array(
'name' => 'location',
'label' => 'Location',
'type' => 'select',
'options' => get_array_of_locations(),
),
array(
'name' => 'property_type',
'label' => 'Type',
'type' => 'select',
'options' => get_array_of_property_types(),
),
array(
'name' => 'postcode',
'label' => 'Postcode',
'type' => 'text',
),
)
);
但是我不知道如何添加到我的新$property中
define( 'ATTACHMENTS_LEGACY', true ); // force the legacy version of Attachments
在配置文件的顶部而不是底部,它工作了