Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/227.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Wordpress函数-向新分类添加插件_Php_Wordpress_Wordpress Theming - Fatal编程技术网

Php Wordpress函数-向新分类添加插件

Php Wordpress函数-向新分类添加插件,php,wordpress,wordpress-theming,Php,Wordpress,Wordpress Theming,我有一个wordpress站点,在仪表板中,我添加了一个新的菜单项-属性,它有一个元字段列表,如位置、价格等 此外,我还想向它添加附件插件,这样每个新的属性都可以为我设置的图像库添加附件。我该怎么做 更多信息,我在我的functions.php中定义了: $property->add_meta_box( 'Property Info', array( array( 'name' => 'price',

我有一个wordpress站点,在仪表板中,我添加了一个新的菜单项-属性,它有一个元字段列表,如位置、价格等

此外,我还想向它添加附件插件,这样每个新的属性都可以为我设置的图像库添加附件。我该怎么做

更多信息,我在我的functions.php中定义了:

$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
在配置文件的顶部而不是底部,它工作了