Skip to content

Instantly share code, notes, and snippets.

@erikpantzar
Last active August 29, 2015 14:11
Show Gist options
  • Save erikpantzar/c35aa0b9c2f81344bf51 to your computer and use it in GitHub Desktop.
Save erikpantzar/c35aa0b9c2f81344bf51 to your computer and use it in GitHub Desktop.
<?php
$_template = 'retailerlist';
$fields_content = new \CWP\FieldContainer($_template . "_settings", array(
'meta_box' => \CWP\MetaBox::Get('page_settings', array(
'title' => 'Sidinställningar',
'priority' => 'high',
'context' => 'side',
'none' => false,
))
));
$fields_content->rules[] = array(
array('type' => 'template', 'value' => "templates/$_template.php")
);
$fields_content->Save();
$fields_content->support_editor = false;
$fields_content->AddFields(array(
new \CWP\RepeaterField('retailer-list', 'Återförsäljare', array(
'labels' => array(),
'fields' => array(
new \CWP\TextField('retailer-title', 'ÅF Namn'),
new \CWP\TextField('retailer-content', 'ÅF Information', array('multiline' => true)),
new \CWP\TextField('retailer-adress', 'ÅF Adress'),
new \CWP\TextField('retailer-city', 'ÅF Stad'),
new \CWP\TextField('retailer-phone', 'ÅF Telefonnummer'),
new \CWP\TextField('retailer-lat', 'ÅF Latitude'),
new \CWP\TextField('retailer-long', 'ÅF Longitude'),
new \CWP\BooleanField('retailer-campaign', 'ÅF Är med i kampanj?'),
),
)),
));
$fields_content->Save();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment