2013-02-22 68 views
0

我有一個wordpress網站,並在儀表板中,我添加了一個新的菜單項 - 屬性,它有一個元字段列表,如位置,價格等。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/添加到我的新$財產

回答

1

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

在配置文件的頂部,而不是底部,它的工作。