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 e87cf05 commit f3a8867
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 39 deletions.
36 changes: 18 additions & 18 deletions example-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -400,33 +400,33 @@ function yourprefix_register_repeatable_group_field_metabox() {
* 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 first argument.
* The parent field's id needs to be passed as the second argument.
*/
$cmb_group->add_group_field( $group_field_id, array(
'name' => __( 'Entry Title', 'cmb2' ),
'id' => 'title',
'type' => 'text',
$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(
'name' => __( 'Description', 'cmb2' ),
'description' => __( 'Write a short description for this entry', 'cmb2' ),
'id' => 'description',
'type' => 'textarea_small',
) );
$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(
'name' => __( 'Entry Image', 'cmb2' ),
$cmb_group->add_field( array(
'name' => 'Entry Image',
'id' => 'image',
'type' => 'file',
) );
), $group_field_id );

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

}

Expand Down
22 changes: 1 addition & 21 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:52:14+00:00\n"
"POT-Creation-Date: 2015-02-15 01:52:19+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand Down Expand Up @@ -229,26 +229,6 @@ msgstr ""
msgid "Remove Entry"
msgstr ""

#: example-functions.php:406
msgid "Entry Title"
msgstr ""

#: example-functions.php:413
msgid "Description"
msgstr ""

#: example-functions.php:414
msgid "Write a short description for this entry"
msgstr ""

#: example-functions.php:420
msgid "Entry Image"
msgstr ""

#: example-functions.php:426
msgid "Image Caption"
msgstr ""

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

0 comments on commit f3a8867

Please sign in to comment.