Skip to content

Instantly share code, notes, and snippets.

@szmeku
Created June 4, 2013 10:14
Show Gist options
  • Save szmeku/5704950 to your computer and use it in GitHub Desktop.
Save szmeku/5704950 to your computer and use it in GitHub Desktop.
<?php
$box = array(
array(
'name' => 'image',
'label' => 'Upload Image',
'type' => 'image',
),
array(
'name' => 'header',
'label' => 'Header',
'type' => 'text',
),
array(
'name' => 'header_color',
'type' => 'color',
),
array(
'name' => 'subheader',
'label' => 'Sub - Header',
'type' => 'text',
),
array(
'name' => 'subheader_color',
'type' => 'color',
),
array(
'name' => 'link',
'label' => 'Link',
'type' => 'url',
),
array(
'name' => 'width',
'type' => 'select',
'label' => 'Box Width',
'options' => call_user_func(function () {
$options = array();
for ($i = 1; $i < 13; $i++) {
$options[] = array(
'value' => $i,
'label' => "$i column(s)"
);
}
return $options;
}),
'default' => 5,
),
);
$this->masonry_meta = new CCI_MetaBox(array(
'name' => 'cci_masonry_meta',
'label' => 'Masonry',
'post_types' => array('cci_masonry'),
'fields' => array(
array(
'name' => 'width',
'label' => 'Masonry Width',
'type' => 'int'
),
array(
'name' => 'box_margin',
'label' => 'Box Margin',
'type' => 'int'
),
array(
'name' => 'boxes',
'type' => 'array',
'label' => 'Boxes',
'label_single' => 'Box',
'structure' => $box
),
)
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment