【问题标题】:Wordpress Functions - adding plugins to new taxonomyWordpress 功能 - 将插件添加到新分类法中
【发布时间】:2013-03-07 00:01:08
【问题描述】:

我有一个 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',
        ),
    )
);

但我不知道如何将http://wordpress.org/extend/plugins/attachments/installation/ 添加到我的新 $property 中

【问题讨论】:

    标签: php wordpress wordpress-theming


    【解决方案1】:

    define( 'ATTACHMENTS_LEGACY', true ); // force the legacy version of Attachments
    

    在配置文件的顶部而不是底部,它起作用了。

    【讨论】:

      猜你喜欢
      • 2012-08-08
      • 2020-09-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-12-26
      • 1970-01-01
      • 2012-06-09
      相关资源
      最近更新 更多