Skip to content
This repository has been archived by the owner on Aug 28, 2019. It is now read-only.

Commit

Permalink
v0.1 Initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
ajitbohra committed Oct 11, 2016
1 parent 488bfc0 commit 4750cb4
Show file tree
Hide file tree
Showing 29 changed files with 411 additions and 0 deletions.
13 changes: 13 additions & 0 deletions fieldtypes/checkbox.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<snippet>
<content><![CDATA[
array(
'id' => $prefix.'${1:checkbox}',
'name' => '${2:checkbox label}',
'type' => 'checkbox',
),
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>cmb:checkbox</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>
13 changes: 13 additions & 0 deletions fieldtypes/colorpicker.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<snippet>
<content><![CDATA[
array(
'id' => $prefix.'${1:colorpicker}',
'name' => '${2:A color picker input}',
'type' => 'colorpicker',
),
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>cmb:colorpicker</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>
13 changes: 13 additions & 0 deletions fieldtypes/date.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<snippet>
<content><![CDATA[
array(
'id' => $prefix.'${1:date}',
'name' => '${2:A date field}',
'type' => 'date',
),
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>cmb:date</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>
13 changes: 13 additions & 0 deletions fieldtypes/date_unix.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<snippet>
<content><![CDATA[
array(
'id' => $prefix.'${1:date_unix}',
'name' => '${2:A unix date field}',
'type' => 'date_unix',
),
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>cmb:date_unix</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>
13 changes: 13 additions & 0 deletions fieldtypes/datetime_unix.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<snippet>
<content><![CDATA[
array(
'id' => $prefix.'${1:datetime_unix}',
'name' => '${2:A unix date and time field}',
'type' => 'datetime_unix',
),
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>cmb:datetime_unix</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>
13 changes: 13 additions & 0 deletions fieldtypes/file.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<snippet>
<content><![CDATA[
array(
'id' => $prefix.'${1:file}',
'name' => '${2:A file field}',
'type' => 'file',
),
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>cmb:file</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>
14 changes: 14 additions & 0 deletions fieldtypes/gmap.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<snippet>
<content><![CDATA[
array(
'id' => $prefix.'${1:gmap}',
'name' => '${2:Location using google map}',
'type' => 'gmap',
'google_api_key ' => '${3:GOOGLE_API_KEY}'
),
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>cmb:gmap</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>
16 changes: 16 additions & 0 deletions fieldtypes/group.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<snippet>
<content><![CDATA[
array(
'id' => $prefix.'${1:group}',
'name' => '${2:A field group}',
'type' => 'group',
'fields' => array(
// Add your fields here
)
),
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>cmb:group</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>
13 changes: 13 additions & 0 deletions fieldtypes/image.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<snippet>
<content><![CDATA[
array(
'id' => $prefix.'${1:image}',
'name' => '${2:An image input}',
'type' => 'image',
),
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>cmb:image</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>
13 changes: 13 additions & 0 deletions fieldtypes/number.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<snippet>
<content><![CDATA[
array(
'id' => $prefix.'${1:number}',
'name' => '${2:A simple number field}',
'type' => 'number',
),
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>cmb:number</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>
17 changes: 17 additions & 0 deletions fieldtypes/post_select.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<snippet>
<content><![CDATA[
array(
'id' => $prefix.'${1:post_select}',
'name' => '${2:Post Select Field}',
'type' => 'post_select',
'use_ajax' => true,
'query' => array(
'cat' => ${3:8}
)
);
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>cmb:post_select</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>
20 changes: 20 additions & 0 deletions fieldtypes/radio.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<snippet>
<content><![CDATA[
array(
'id' => $prefix.'${1:radio}',
'name' => '${2:Radio Field}',
'type' => 'radio',
'options' => array(
'${3:option-1}' => '${4:Option 1}',
'${5:option-2}' => '${6:Option 2}',
'${7:option-3}' => '${8:Option 3}',
)
),
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>cmb:radio</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>


20 changes: 20 additions & 0 deletions fieldtypes/select.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<snippet>
<content><![CDATA[
array(
'id' => $prefix.'${1:select}',
'name' => '${2:Select Field}',
'type' => 'select',
'options' => array(
'${3:option-1}' => '${4:Option 1}',
'${5:option-2}' => '${6:Option 2}',
'${7:option-3}' => '${8:Option 3}',
)
),
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>cmb:select</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>


14 changes: 14 additions & 0 deletions fieldtypes/taxonomy_select.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<snippet>
<content><![CDATA[
array(
'id' => $prefix.'${1:taxonomy_select}',
'name' => '${2:Taxonomy Select Field}',
'type' => 'taxonomy_select',
'taxonomy' => '${3:category}'
);
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>cmb:taxonomy_select</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>
13 changes: 13 additions & 0 deletions fieldtypes/text.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<snippet>
<content><![CDATA[
array(
'id' => $prefix.'${1:text}',
'name' => '${2:A simple text input}',
'type' => 'text',
),
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>cmb:text</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>
13 changes: 13 additions & 0 deletions fieldtypes/text_small.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<snippet>
<content><![CDATA[
array(
'id' => $prefix.'${1:text_small}',
'name' => '${2:A small text input}',
'type' => 'text_small',
),
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>cmb:text_small</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>
13 changes: 13 additions & 0 deletions fieldtypes/text_url.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<snippet>
<content><![CDATA[
array(
'id' => $prefix.'${1:url}',
'name' => '${2:A simple text url}',
'type' => 'text_url',
),
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>cmb:text_url</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>
15 changes: 15 additions & 0 deletions fieldtypes/textarea.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<snippet>
<content><![CDATA[
array(
'id' => $prefix.'${1:textarea}',
'name' => '${2:A textarea field}',
'type' => 'textarea',
'rows' => 6,
),
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>cmb:textarea</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>

15 changes: 15 additions & 0 deletions fieldtypes/textarea_code.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<snippet>
<content><![CDATA[
array(
'id' => $prefix.'${1:textarea_code}',
'name' => '${2:A textarea code field}',
'type' => 'textarea_code',
'rows' => 6,
),
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>cmb:textarea_code</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>

13 changes: 13 additions & 0 deletions fieldtypes/time.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<snippet>
<content><![CDATA[
array(
'id' => $prefix.'${1:time}',
'name' => '${2:A time field}',
'type' => 'time',
),
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>cmb:time</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>
13 changes: 13 additions & 0 deletions fieldtypes/title.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<snippet>
<content><![CDATA[
array(
'id' => $prefix.'${1:title}',
'name' => '${2:Title Text}',
'type' => 'title',
),
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>cmb:title</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>
18 changes: 18 additions & 0 deletions fieldtypes/wysiwyg.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<snippet>
<content><![CDATA[
array(
'id' => $prefix.'${1:wysiwyg}',
'name' => '${2:A WYSIWYG editor field}',
'type' => 'wysiwyg',
'options' => array(
'textarea_rows' => 5
)
),
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>cmb:wysiwyg</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>


29 changes: 29 additions & 0 deletions helper/create.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<snippet>
<content><![CDATA[
add_filter( 'cmb_meta_boxes', '${1:cmb_sample_metaboxes}' );
function ${2:cmb_sample_metaboxes}( array $meta_boxes ) {
$fields = array(
${3:// Add you fields here}
);
$meta_boxes[] = array(
'title' => '${4:CMB Test - all fields}',
'pages' => '${5:page}',
'show_on' => array( 'id' => array( 1 ) ),
'hide_on' => array( 'page-template' => array( 'test-page-template.php' ) ),
'context' => 'normal',
'priority' => 'high',
'fields' => $fields, // an array of fields - see individual field
'desc' => '${6:This is the meta box description.}',
);
return $meta_boxes;
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>cmb:create/</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>text.php</scope>-->
</snippet>
9 changes: 9 additions & 0 deletions helper/display.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<snippet>
<content><![CDATA[
get_post_meta( get_the_id(), '${1:YOUR_FIELD_ID}', true );
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>cmb:display</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>
12 changes: 12 additions & 0 deletions helper/display_group.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<snippet>
<content><![CDATA[
$group_data = get_post_meta( get_the_id(), '${1:YOUR_GROUP_ID}', true );
if ( ! empty( $group_data['${1:YOUR_GROUP_ID}'] ) )
echo esc_html( $group_data['${1:YOUR_GROUP_ID}'] );
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>cmb:display_group</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>
Loading

0 comments on commit 4750cb4

Please sign in to comment.