Skip to content

Commit

Permalink
bump version number
Browse files Browse the repository at this point in the history
  • Loading branch information
mattheu committed Mar 25, 2014
1 parent 3379c79 commit 335e4ba
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
34 changes: 17 additions & 17 deletions custom-meta-boxes.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Human Made Limited ( @humanmadeltd / hmn.md )
Jonathan Bardo ( @jonathanbardo / jonathanbardo.com )
Description: This will create metaboxes with custom fields that will blow your mind.
Version: 1.0 - Beta 1
Version: 1.0.1
*/

/**
Expand Down Expand Up @@ -55,7 +55,7 @@

/**
* Get all the meta boxes on init
*
*
* @return null
*/
function cmb_init() {
Expand Down Expand Up @@ -85,7 +85,7 @@ function cmb_init() {
*
* Key is field name, Value is class used by field.
* Available fields can be modified using the 'cmb_field_types' filter.
*
*
* @return array
*/
function _cmb_available_fields() {
Expand Down Expand Up @@ -118,8 +118,8 @@ function _cmb_available_fields() {

/**
* Get a field class by type
*
* @param string $type
*
* @param string $type
* @return string $class, or false if not found.
*/
function _cmb_field_class_for_type( $type ) {
Expand All @@ -134,24 +134,24 @@ function _cmb_field_class_for_type( $type ) {
}

/**
* For the order of repeatable fields to be guaranteed, orderby meta_id needs to be set.
* For the order of repeatable fields to be guaranteed, orderby meta_id needs to be set.
* Note usermeta has a different meta_id column name.
*
*
* Only do this for older versions as meta is now ordered by ID (since 3.8)
* See http://core.trac.wordpress.org/ticket/25511
*
*
* @param string $query
* @return string $query
*/
function cmb_fix_meta_query_order($query) {

$pattern = '/^SELECT (post_id|user_id), meta_key, meta_value FROM \w* WHERE post_id IN \([\d|,]*\)$/';
if (
0 === strpos( $query, "SELECT post_id, meta_key, meta_value" ) &&
preg_match( $pattern, $query, $matches )
) {

if (
0 === strpos( $query, "SELECT post_id, meta_key, meta_value" ) &&
preg_match( $pattern, $query, $matches )
) {

if ( isset( $matches[1] ) && 'user_id' == $matches[1] )
$meta_id_column = 'umeta_id';
else
Expand All @@ -161,12 +161,12 @@ function cmb_fix_meta_query_order($query) {

if ( false === strpos( $query, $meta_query_orderby ) )
$query .= $meta_query_orderby;

}

return $query;

}

if ( version_compare( get_bloginfo( 'version' ), '3.8', '<' ) )
add_filter( 'query', 'cmb_fix_meta_query_order', 1 );
add_filter( 'query', 'cmb_fix_meta_query_order', 1 );
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Custom-Meta-Boxes",
"version": "0.1.0-beta",
"version": "1.0.1",
"description": "Custom Meta Boxes is a framework for easily adding custom fields to the WordPress post edit page.",
"homepage": "https://github.com/humanmade/Custom-Meta-Boxes/",
"repository": {
Expand Down

0 comments on commit 335e4ba

Please sign in to comment.