This repository has been archived by the owner on Aug 28, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
411 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
Oops, something went wrong.