Skip to content

Commit

Permalink
update example to not use add_group_field
Browse files Browse the repository at this point in the history
  • Loading branch information
jtsternberg committed Feb 15, 2015
1 parent 2ef6b8b commit 1b52709
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 85 deletions.
25 changes: 15 additions & 10 deletions example-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
/**
* Include and setup custom metaboxes and fields. (make sure you copy this file to outside the CMB directory)
*
* Be sure to replace all instances of 'yourprefix_' with your project's prefix.
* http://nacin.com/2010/05/11/in-wordpress-prefix-everything/
*
* @category YourThemeOrPlugin
* @package Metaboxes
* @license http://www.opensource.org/licenses/gpl-license.php GPL v2.0 (or later)
* @link https://github.com/webdevstudios/Custom-Metaboxes-and-Fields-for-WordPress
* @link https://github.com/WebDevStudios/CMB2
*/

/**
Expand Down Expand Up @@ -394,34 +397,36 @@ function yourprefix_register_repeatable_group_field_metabox() {
) );

/**
* Fields array works the same, except ids only need
* Group fields works the same, except ids only need
* to be unique to the group. Prefix is not needed.
*
* The parent field's id needs to be passed as the second argument.
*/
$cmb_group->add_group_field( $group_field_id, array(
$cmb_group->add_field( array(
'name' => 'Entry Title',
'id' => 'title',
'type' => 'text',
// 'repeatable' => true, // Repeatable fields are supported w/in repeatable groups (for most types)
) );
), $group_field_id );

$cmb_group->add_group_field( $group_field_id, array(
$cmb_group->add_field( array(
'name' => 'Description',
'description' => 'Write a short description for this entry',
'id' => 'description',
'type' => 'textarea_small',
) );
), $group_field_id );

$cmb_group->add_group_field( $group_field_id, array(
$cmb_group->add_field( array(
'name' => 'Entry Image',
'id' => 'image',
'type' => 'file',
) );
), $group_field_id );

$cmb_group->add_group_field( $group_field_id, array(
$cmb_group->add_field( array(
'name' => 'Image Caption',
'id' => 'image_caption',
'type' => 'text',
) );
), $group_field_id );

}

Expand Down
150 changes: 75 additions & 75 deletions languages/cmb2.pot
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: CMB2 2.0.2\n"
"Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/cmb2\n"
"POT-Creation-Date: 2015-02-15 01:49:33+00:00\n"
"POT-Creation-Date: 2015-02-15 01:49:46+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand All @@ -24,248 +24,248 @@ msgstr ""
"X-Poedit-Bookmarks: \n"
"X-Textdomain-Support: yes\n"

#: example-functions.php:64
#: example-functions.php:67
msgid "Test Metabox"
msgstr ""

#: example-functions.php:74 example-functions.php:357
#: example-functions.php:77 example-functions.php:360
msgid "Test Text"
msgstr ""

#: example-functions.php:75 example-functions.php:87 example-functions.php:95
#: example-functions.php:103 example-functions.php:112
#: example-functions.php:120 example-functions.php:134
#: example-functions.php:141 example-functions.php:149
#: example-functions.php:165 example-functions.php:174
#: example-functions.php:182 example-functions.php:189
#: example-functions.php:196 example-functions.php:210
#: example-functions.php:222 example-functions.php:234
#: example-functions.php:246 example-functions.php:255
#: example-functions.php:263 example-functions.php:272
#: example-functions.php:279 example-functions.php:292
#: example-functions.php:358 example-functions.php:450
#: example-functions.php:458 example-functions.php:465
#: example-functions.php:472 example-functions.php:479
#: example-functions.php:486 example-functions.php:493
#: example-functions.php:531
#: example-functions.php:78 example-functions.php:90 example-functions.php:98
#: example-functions.php:106 example-functions.php:115
#: example-functions.php:123 example-functions.php:137
#: example-functions.php:144 example-functions.php:152
#: example-functions.php:168 example-functions.php:177
#: example-functions.php:185 example-functions.php:192
#: example-functions.php:199 example-functions.php:213
#: example-functions.php:225 example-functions.php:237
#: example-functions.php:249 example-functions.php:258
#: example-functions.php:266 example-functions.php:275
#: example-functions.php:282 example-functions.php:295
#: example-functions.php:361 example-functions.php:455
#: example-functions.php:463 example-functions.php:470
#: example-functions.php:477 example-functions.php:484
#: example-functions.php:491 example-functions.php:498
#: example-functions.php:536
msgid "field description (optional)"
msgstr ""

#: example-functions.php:86
#: example-functions.php:89
msgid "Test Text Small"
msgstr ""

#: example-functions.php:94
#: example-functions.php:97
msgid "Test Text Medium"
msgstr ""

#: example-functions.php:102
#: example-functions.php:105
msgid "Website URL"
msgstr ""

#: example-functions.php:111
#: example-functions.php:114
msgid "Test Text Email"
msgstr ""

#: example-functions.php:119
#: example-functions.php:122
msgid "Test Time"
msgstr ""

#: example-functions.php:126 example-functions.php:127
#: example-functions.php:129 example-functions.php:130
msgid "Time zone"
msgstr ""

#: example-functions.php:133
#: example-functions.php:136
msgid "Test Date Picker"
msgstr ""

#: example-functions.php:140
#: example-functions.php:143
msgid "Test Date Picker (UNIX timestamp)"
msgstr ""

#: example-functions.php:148
#: example-functions.php:151
msgid "Test Date/Time Picker Combo (UNIX timestamp)"
msgstr ""

#: example-functions.php:164
#: example-functions.php:167
msgid "Test Money"
msgstr ""

#: example-functions.php:173
#: example-functions.php:176
msgid "Test Color Picker"
msgstr ""

#: example-functions.php:181
#: example-functions.php:184
msgid "Test Text Area"
msgstr ""

#: example-functions.php:188
#: example-functions.php:191
msgid "Test Text Area Small"
msgstr ""

#: example-functions.php:195
#: example-functions.php:198
msgid "Test Text Area for Code"
msgstr ""

#: example-functions.php:202
#: example-functions.php:205
msgid "Test Title Weeeee"
msgstr ""

#: example-functions.php:203
#: example-functions.php:206
msgid "This is a title description"
msgstr ""

#: example-functions.php:209
#: example-functions.php:212
msgid "Test Select"
msgstr ""

#: example-functions.php:214 example-functions.php:226
#: example-functions.php:238
#: example-functions.php:217 example-functions.php:229
#: example-functions.php:241
msgid "Option One"
msgstr ""

#: example-functions.php:215 example-functions.php:227
#: example-functions.php:239
#: example-functions.php:218 example-functions.php:230
#: example-functions.php:242
msgid "Option Two"
msgstr ""

#: example-functions.php:216 example-functions.php:228
#: example-functions.php:240
#: example-functions.php:219 example-functions.php:231
#: example-functions.php:243
msgid "Option Three"
msgstr ""

#: example-functions.php:221
#: example-functions.php:224
msgid "Test Radio inline"
msgstr ""

#: example-functions.php:233
#: example-functions.php:236
msgid "Test Radio"
msgstr ""

#: example-functions.php:245
#: example-functions.php:248
msgid "Test Taxonomy Radio"
msgstr ""

#: example-functions.php:254
#: example-functions.php:257
msgid "Test Taxonomy Select"
msgstr ""

#: example-functions.php:262
#: example-functions.php:265
msgid "Test Taxonomy Multi Checkbox"
msgstr ""

#: example-functions.php:271
#: example-functions.php:274
msgid "Test Checkbox"
msgstr ""

#: example-functions.php:278
#: example-functions.php:281
msgid "Test Multi Checkbox"
msgstr ""

#: example-functions.php:283
#: example-functions.php:286
msgid "Check One"
msgstr ""

#: example-functions.php:284
#: example-functions.php:287
msgid "Check Two"
msgstr ""

#: example-functions.php:285
#: example-functions.php:288
msgid "Check Three"
msgstr ""

#: example-functions.php:291
#: example-functions.php:294
msgid "Test wysiwyg"
msgstr ""

#: example-functions.php:299
#: example-functions.php:302
msgid "Test Image"
msgstr ""

#: example-functions.php:300
#: example-functions.php:303
msgid "Upload an image or enter a URL."
msgstr ""

#: example-functions.php:306
#: example-functions.php:309
msgid "Multiple Files"
msgstr ""

#: example-functions.php:307
#: example-functions.php:310
msgid "Upload or add multiple images/attachments."
msgstr ""

#: example-functions.php:314
#: example-functions.php:317
msgid "oEmbed"
msgstr ""

#: example-functions.php:315
#: example-functions.php:318
msgid ""
"Enter a youtube, twitter, or instagram URL. Supports services listed at <a "
"href=\"http://codex.wordpress.org/Embeds\">http://codex.wordpress.org/"
"Embeds</a>."
msgstr ""

#: example-functions.php:348
#: example-functions.php:351
msgid "About Page Metabox"
msgstr ""

#: example-functions.php:379
#: example-functions.php:382
msgid "Repeating Field Group"
msgstr ""

#: example-functions.php:387
#: example-functions.php:390
msgid "Generates reusable form entries"
msgstr ""

#: example-functions.php:389
#: example-functions.php:392
msgid "Entry {#}"
msgstr ""

#: example-functions.php:390
#: example-functions.php:393
msgid "Add Another Entry"
msgstr ""

#: example-functions.php:391
#: example-functions.php:394
msgid "Remove Entry"
msgstr ""

#: example-functions.php:442
#: example-functions.php:447
msgid "User Profile Metabox"
msgstr ""

#: example-functions.php:449
#: example-functions.php:454
msgid "Extra Info"
msgstr ""

#: example-functions.php:457
#: example-functions.php:462
msgid "Avatar"
msgstr ""

#: example-functions.php:464
#: example-functions.php:469
msgid "Facebook URL"
msgstr ""

#: example-functions.php:471
#: example-functions.php:476
msgid "Twitter URL"
msgstr ""

#: example-functions.php:478
#: example-functions.php:483
msgid "Google+ URL"
msgstr ""

#: example-functions.php:485
#: example-functions.php:490
msgid "Linkedin URL"
msgstr ""

#: example-functions.php:492
#: example-functions.php:497
msgid "User Field"
msgstr ""

#: example-functions.php:515
#: example-functions.php:520
msgid "Theme Options Metabox"
msgstr ""

#: example-functions.php:530
#: example-functions.php:535
msgid "Site Background Color"
msgstr ""

Expand Down

0 comments on commit 1b52709

Please sign in to comment.