0

ワードプレスのサイトがあり、ダッシュボードに新しいメニュー項目を追加しました。プロパティには、場所、価格などのメタフィールドのリストがあります。

しかし、これにも添付ファイルプラグインを追加したいので、新しい単一のプロパティごとに、設定した画像ギャラリーの添付ファイルを追加できます。どうすればよいですか?

これに関する詳細情報として、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にhttp://wordpress.org/extend/plugins/attachments/installation/を追加する方法がわかりません。

4

1 に答える 1

1

置く

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

設定ファイルの下部ではなく上部にあり、機能しました。

于 2013-03-06T16:01:08.970 に答える