Skip to content

Commit

Permalink
Merge branch 'trunk'
Browse files Browse the repository at this point in the history
  • Loading branch information
jtsternberg committed Jun 27, 2016
2 parents 892fee8 + 8ea9ccb commit 586d45c
Show file tree
Hide file tree
Showing 77 changed files with 6,209 additions and 10,271 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ phpunit.xml export-ignore
tests export-ignore
composer.json export-ignore
readme.md export-ignore
README.md export-ignore
.idea export-ignore
.scrutinizer.yml export-ignore
coverage.clover export-ignore
Expand Down
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ php:
- 5.4
- 5.5
- 5.6
- 7.0
- hhvm
- nightly

Expand All @@ -21,6 +22,14 @@ matrix:
php: nightly
- env: WP_VERSION=3.8 WP_MULTISITE=1
php: nightly
- env: WP_VERSION=latest WP_MULTISITE=0
php: nightly
- env: WP_VERSION=latest WP_MULTISITE=1
php: nightly
- env: WP_VERSION=3.8 WP_MULTISITE=0
php: 7.0
- env: WP_VERSION=3.8 WP_MULTISITE=1
php: 7.0

before_script:
- bash tests/bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION
Expand Down
35 changes: 32 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,35 @@ All notable changes to this project will be documented in this file.

## [Unreleased][unreleased]

## 2.2.2 - 2016-06-27

### Enhancements

* You can now set admin post-listing columns with an extra field parameter, `'column' => true,`. If you want to dictate what position the column is, use `'column' => array( 'position' => 2 ),`. If you want to dictate the column title (instead of using the field `'name'` value), use `'column' => array( 'name' => 'My Column' ),`. If you need to specify the column display callback, set the `'display_cb'` parameter to [a callback function](https://github.com/WebDevStudios/CMB2/wiki/Field-Parameters#render_row_cb). Columns work for post (all post-types), comment, user, and term object types.
* Updated Datepicker styles using JJJ's "jQuery UI Datepicker CSS for WordPress", so props Props [@stuttter](https://github.com/stuttter), [@johnjamesjacoby](https://github.com/johnjamesjacoby). Also cleaned up the timepicker styles (specifically the buttons) to more closely align with the datepicker and WordPress styles.
* CMB2 is now a lot more intelligent about where it is located in your installation. This update should solve almost all of the reasons to use the `'cmb2_meta_box_url'` filter (thought it will continue to work as expected). ([#27](https://github.com/WebDevStudios/CMB2/issues/27), [#118](https://github.com/WebDevStudios/CMB2/issues/118), [#432](https://github.com/WebDevStudios/CMB2/issues/432), [related wiki item](https://github.com/WebDevStudios/CMB2/wiki/Troubleshooting#cmb2-urls-issues))
* Implement CMB2_Ajax as a singleton. Props [jrfnl](https://github.com/jrfnl) ([#602](https://github.com/WebDevStudios/CMB2/pull/602)).
* Add `classes` and `classes_cb` CMB2 box params which allows you to add additional classes to the cmb-wrap. The `classes` parameter can take a string or array, and the `classes_cb` takes a callback which returns a string or array. The callback will receive `$cmb` as an argument. These classes are also passed through a new filter, `'cmb2_wrap_classes'`, which receives the array of classes as the first argument, and the CMB2 object as the second. Reported/requested in [#364](https://github.com/WebDevStudios/CMB2/issues/364#issuecomment-213223692).
* Make the `'title'` field type accept extra arguments. Props [@vladolaru](https://github.com/vladolaru), [@pixelgrade](https://github.com/pixelgrade) ([#656](https://github.com/WebDevStudios/CMB2/pull/656)).
* Updated `cmb2_get_oembed()` function to NOT return the "remove" link, as it's intended for outputting the oembed only. **This is a backwards-compatibility concern.** If you were depending on the "remove" link, use `cmb2_ajax()->get_oembed( $args )` instead.
* New function, `cmb2_do_oembed()`', which is hooked to `'cmb2_do_oembed'`, so you can use `do_action( 'cmb2_do_oembed', $args )` in your themes without `function_exists()` checks.
* New method, `CMB2:set_prop( $property, $value )`, for setting a CMB2 metabox object property.
* The `CMB2_Field` object instances will now have a `cmb_id` property and a `get_cmb` method to enable access to the field's `CMB2` parent object's instance, in places like field callbacks and filters (e.g. `$cmb = $field->get_cmb();`).
* Add a `data-fieldtype` attribute to the field rows for simpler identification in Javascript.
* Moved each type in `CMB2_Types` to it's own class so that each field type can handle it's own field display, and added the infrastructure to maintainn back-compatibility.
* New `CMB2_Utils` methods, `notempty()` and `filter_empty()`, both of which consider `null`, `''` and `false` as empty, but allow `0` (for saving `0` as a field value).
* New `CMB2_Utils` public methods, `get_url_from_dir()`, `get_file_ext()`, `get_file_name_from_path()`, and `wp_at_least()`.
* Add a `cmb_pre_init` Javascript event to allow overriding CMB2 defaults via JS.

### Bug Fixes
* Fix issue with 'default' callback not being applied in all instances. Introduced new `CMB2_Field::get_default()` method, and `'default_cb'` field parameter. Using the `'default'` field parameter with a callback will be deprecated in the next few releases. ([#572](https://github.com/WebDevStudios/CMB2/issues/572)).
* Be sure to call `CMB2_Field::row_classes()` for group field rows. Also, update CSS to use the "cmb-type-group" classname instead of "cmb-repeat-group-wrap".
* Introduce new `'text'` and `'text_cb'` field parameters for overriding CMB2 text strings instead of using the `'options'` array. ([#630](https://github.com/WebDevStudios/CMB2/pull/630))
* Fix bug where the value of '0' could not be saved in group fields.
* Fix bug where a serialized empty array value in the database for a repeatable field would output as "Array".
* Allow for optional/empty money field. Props [@jrfnl](https://github.com/jrfnl) ([#577](https://github.com/WebDevStudios/CMB2/pull/577)).
* The `CMB2::$updated` parameter (which contains field ids for all fields updated during a save) now also correctly adds group field ids to the array.

## 2.2.1 - 2016-02-29

### Bug Fixes
Expand Down Expand Up @@ -103,9 +132,9 @@ All notable changes to this project will be documented in this file.
* Ability to use non-repeatable group fields by setting the `'repeatable'` field param to `false` when registering a group field type. Props [marcusbattle](https://github.com/marcusbattle), ([#159](https://github.com/WebDevStudios/CMB2/pull/159)).
* Add and enqeueue a front-end specific CSS file which adds additional styles which are typically covered by wp-admin css. ([#311](https://github.com/WebDevStudios/CMB2/issues/311))
* Better handling of the CMB2 javascript (and CSS) required dependencies array. Dependencies are now only added conditionally based on the field types that are actually visible. ([#136](https://github.com/WebDevStudios/CMB2/issues/136))
* **THIS IS A BREAKING CHANGE:** The `group` field type's `'show_on_cb'` property now receives the `CMB2_Field` object instance as an argument instead of the `CMB2` instance. If you're using the `'show_on_cb'` property for a `group` field, please adjust accordingly. _note: you can still retrieve the `CMB2` instance via the `cmb2_get_metabox` helper function._
* **THIS IS A BREAKING CHANGE:** The `group` field type's `'show_on_cb'` parameter now receives the `CMB2_Field` object instance as an argument instead of the `CMB2` instance. If you're using the `'show_on_cb'` parameter for a `group` field, please adjust accordingly. _note: you can still retrieve the `CMB2` instance via the `cmb2_get_metabox` helper function._
* New dynamic hook, `"cmb2_save_{$object_type}_fields_{$this->cmb_id}"`, to complement the existing `"cmb2_save_{$object_type}_fields"` hook.
* New CMB2 property, `enqueue_js`, to disable the enqueueing of the CMB2 Javascript.
* New CMB2 parameter, `enqueue_js`, to disable the enqueueing of the CMB2 Javascript.
* German translation provided by Friedhelm Jost.

### Bug Fixes
Expand Down Expand Up @@ -171,7 +200,7 @@ All notable changes to this project will be documented in this file.
* Added a callback option for the field default value. The callback gets passed an array of all the field parameters as the first argument, and the field object as the second argument. (which means you can get the post id using `$field->object_id`). ([#233](https://github.com/WebDevStudios/CMB2/issues/233)).
* New `CMB2::get_field()` method and `cmb2_get_field` helper function for retrieving a `CMB2_Field` object from the array of registered fields for a metabox.
* New `CMB2::get_sanitized_values()` method and `cmb2_get_metabox_sanitized_values` helper function for retrieving sanitized values from an array of values (usually `$_POST` data).
* New `'save_fields'` metabox property that can be used to disable (by setting `'save_fields' => false`) the automatic saving of the fields when the form is submitted. These can be useful when you want to handle the saving of the fields yourself, or want to use submitted data for other purposes like generating new posts, or sending emails, etc.
* New `'save_fields'` metabox parameter that can be used to disable (by setting `'save_fields' => false`) the automatic saving of the fields when the form is submitted. These can be useful when you want to handle the saving of the fields yourself, or want to use submitted data for other purposes like generating new posts, or sending emails, etc.

### Bug Fixes

Expand Down
44 changes: 32 additions & 12 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ module.exports = function(grunt) {
files: [{
expand: false,
cwd: 'css/',
src: ['css/cmb2.css'],
src: ['css/cmb2.css','css/cmb2-display.css'],
dest: 'css/',
}]
}
Expand All @@ -131,7 +131,8 @@ module.exports = function(grunt) {
},
files: {
'css/cmb2.css': 'css/sass/cmb2.scss',
'css/cmb2-front.css': 'css/sass/cmb2-front.scss'
'css/cmb2-front.css': 'css/sass/cmb2-front.scss',
'css/cmb2-display.css': 'css/sass/cmb2-display.scss'
}
}
},
Expand All @@ -157,7 +158,14 @@ module.exports = function(grunt) {
},
minify: {
expand: true,
src: ['css/cmb2.css','css/cmb2-front.css','css/cmb2-rtl.css','css/cmb2-front-rtl.css'],
src: [
'css/cmb2.css',
'css/cmb2-front.css',
'css/cmb2-display.css',
'css/cmb2-rtl.css',
'css/cmb2-front-rtl.css',
'css/cmb2-display-rtl.css'
],
// dest: '',
ext: '.min.css'
}
Expand Down Expand Up @@ -189,9 +197,9 @@ module.exports = function(grunt) {

asciify: {
banner: {
text : 'CMB!',
text : 'CMB2',
options : {
font : 'isometric2',
font : 'univers',
log : true
}
}
Expand Down Expand Up @@ -269,6 +277,7 @@ module.exports = function(grunt) {
swapLtrRtlInUrl: false
},
files: [
{ src: 'css/cmb2-display.css', dest: 'css/cmb2-display-rtl.css' },
{ src: 'css/cmb2-front.css', dest: 'css/cmb2-front-rtl.css' },
{ src: 'css/cmb2.css', dest: 'css/cmb2-rtl.css' }
]
Expand All @@ -295,20 +304,31 @@ module.exports = function(grunt) {

});

grunt.registerTask('styles', ['sass', 'csscomb', 'cmq', 'cssjanus','cssmin']);
grunt.registerTask('js', ['asciify', 'jshint', 'uglify']);
grunt.registerTask('tests', ['asciify', 'jshint', 'phpunit']);
grunt.registerTask('default', ['styles', 'js', 'tests']);
var asciify = ['asciify'];
var styles = ['sass', 'csscomb', 'cmq', 'cssjanus', 'cssmin'];
var js = ['jshint', 'uglify'];
var tests = ['jshint', 'phpunit'];

grunt.registerTask( 'styles', asciify.concat( styles ) );
grunt.registerTask( 'js', asciify.concat( js ) );
grunt.registerTask( 'tests', asciify.concat( tests ) );
grunt.registerTask( 'default', asciify.concat( styles, js, tests ) );

// apigen
grunt.registerTask( 'apigen', asciify.concat( ['exec:apigen'] ) );

// apigen
grunt.registerTask('apigen', ['exec:apigen']);

// apigen
grunt.registerTask('apigen', ['exec:apigen']);

// Checktextdomain and makepot task(s)
grunt.registerTask('build:i18n', ['checktextdomain', 'makepot', 'newer:potomo']);
grunt.registerTask( 'build:i18n', asciify.concat( ['checktextdomain', 'makepot', 'newer:potomo'] ) );

// Makepot and push it on Transifex task(s).
grunt.registerTask('tx-push', ['makepot', 'exec:txpush_s']);
grunt.registerTask( 'tx-push', asciify.concat( ['makepot', 'exec:txpush_s'] ) );

// Pull from Transifex and create .mo task(s).
grunt.registerTask('tx-pull', ['exec:txpull', 'newer:potomo']);
grunt.registerTask( 'tx-pull', asciify.concat( ['exec:txpull', 'newer:potomo'] ) );
};
Loading

0 comments on commit 586d45c

Please sign in to comment.