Skip to content

Commit

Permalink
Set default field argument for 'show_names' to true. Update unit test…
Browse files Browse the repository at this point in the history
…s to reflect this new default.
  • Loading branch information
jtsternberg committed Dec 9, 2014
1 parent fdb5f0b commit 5f7ac76
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions includes/CMB2_Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,7 @@ public function _set_field_defaults( $args ) {
'repeatable' => false,
'inline' => false,
'on_front' => true,
'show_names' => true,
'date_format' => 'm\/d\/Y',
'time_format' => 'h:i A',
'description' => isset( $args['desc'] ) ? $args['desc'] : '',
Expand Down
10 changes: 5 additions & 5 deletions tests/test-cmb-types.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ public function test_wysiwyg_field() {

$field_gen = '
<div class="cmb-row cmb-type-wysiwyg cmb2-id-field-test-field">
<div class="cmb-th"><label for="field_test_field">Name</label></div>
<div class="cmb-td">
<label for="field_test_field">Name</label>
<div id="wp-field_test_field-wrap" class="wp-core-ui wp-editor-wrap html-active">
<link rel=\'stylesheet\' id=\'dashicons-css\' href=\'' . includes_url( "css/dashicons$suffix.css?$version" ) . '\' type=\'text/css\' media=\'all\' />
<link rel=\'stylesheet\' id=\'editor-buttons-css\' href=\'' . includes_url( "css/editor$suffix.css?$version" ) . '\' type=\'text/css\' media=\'all\' />
Expand Down Expand Up @@ -145,8 +145,8 @@ public function test_repeatable_field() {

$field_gen = '
<div class="cmb-row cmb-type-text cmb2-id-field-test-field cmb-repeat table-layout">
<div class="cmb-th"><label for="field_test_field">Name</label></div>
<div class="cmb-td">
<label for="field_test_field">Name</label>
<p class="cmb2-metabox-description">This is a description</p>
<div id="field_test_field_repeat" class="cmb-repeat-table cmb-nested">
<div class="cmb-tbody cmb-field-list">
Expand Down Expand Up @@ -185,8 +185,8 @@ public function test_field_options_cb() {

$field_gen = '
<div class="cmb-row cmb-type-select cmb2-id-options-cb-test-field">
<div class="cmb-th"><label for="options_cb_test_field">Name</label></div>
<div class="cmb-td">
<label for="options_cb_test_field">Name</label>
<select class="cmb2_select" name="options_cb_test_field" id="options_cb_test_field">
<option value="one" >One</option>
<option value="two" >Two</option>
Expand All @@ -211,8 +211,8 @@ public function test_field_options() {

$field_gen = '
<div class="cmb-row cmb-type-select cmb2-id-options-test-field">
<div class="cmb-th"><label for="options_test_field">Name</label></div>
<div class="cmb-td">
<label for="options_test_field">Name</label>
<select class="cmb2_select" name="options_test_field" id="options_test_field">
<option value="one" >One</option>
<option value="two" >Two</option>
Expand All @@ -235,8 +235,8 @@ public function test_field_attributes() {

$field_gen = '
<div class="cmb-row cmb-type-text cmb2-id-attributes-test-field table-layout">
<div class="cmb-th"><label for="attributes_test_field">Name</label></div>
<div class="cmb-td">
<label for="attributes_test_field">Name</label>
<input type="number" class="regular-text" name="attributes_test_field" id="arbitrary-id" value="" disabled="disabled" data-test=\'{"one":"One","two":"Two","true":true,"false":false,"array":{"nested_data":true}}\'/>
<p class="cmb2-metabox-description">This is a description</p>
</div>
Expand Down

0 comments on commit 5f7ac76

Please sign in to comment.