@@ -24,7 +24,7 @@ |
||
| 24 | 24 | $attrs = $this->concat_attrs( $a, array( 'desc', 'options' ) ); |
| 25 | 25 | |
| 26 | 26 | return $this->rendered( |
| 27 | - sprintf( '<select%s>%s</select>%s', $attrs, $a['options'], $a['desc'] ) |
|
| 27 | + sprintf( '<select%s>%s</select>%s', $attrs, $a[ 'options' ], $a[ 'desc' ] ) |
|
| 28 | 28 | ); |
| 29 | 29 | } |
| 30 | 30 | } |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | ), $args ); |
| 32 | 32 | |
| 33 | 33 | return $this->rendered( |
| 34 | - sprintf( '<textarea%s>%s</textarea>%s', $this->concat_attrs( $a, array( 'desc', 'value' ) ), $a['value'], $a['desc'] ) |
|
| 34 | + sprintf( '<textarea%s>%s</textarea>%s', $this->concat_attrs( $a, array( 'desc', 'value' ) ), $a[ 'value' ], $a[ 'desc' ] ) |
|
| 35 | 35 | ); |
| 36 | 36 | } |
| 37 | 37 | } |
@@ -22,12 +22,12 @@ discard block |
||
| 22 | 22 | 'select_timezone' => array(), |
| 23 | 23 | ) ); |
| 24 | 24 | |
| 25 | - $args['value'] = $field->escaped_value(); |
|
| 26 | - if ( is_array( $args['value'] ) ) { |
|
| 27 | - $args['value'] = ''; |
|
| 25 | + $args[ 'value' ] = $field->escaped_value(); |
|
| 26 | + if ( is_array( $args[ 'value' ] ) ) { |
|
| 27 | + $args[ 'value' ] = ''; |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - $datetime = maybe_unserialize( $args['value'] ); |
|
| 30 | + $datetime = maybe_unserialize( $args[ 'value' ] ); |
|
| 31 | 31 | $value = $tzstring = ''; |
| 32 | 32 | |
| 33 | 33 | if ( $datetime && $datetime instanceof DateTime ) { |
@@ -36,19 +36,19 @@ discard block |
||
| 36 | 36 | $value = $datetime->getTimestamp(); |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - $timestamp_args = wp_parse_args( $args['text_datetime_timestamp'], array( |
|
| 39 | + $timestamp_args = wp_parse_args( $args[ 'text_datetime_timestamp' ], array( |
|
| 40 | 40 | 'desc' => '', |
| 41 | 41 | 'value' => $value, |
| 42 | 42 | 'rendered' => true, |
| 43 | 43 | ) ); |
| 44 | 44 | $datetime_timestamp = $this->types->text_datetime_timestamp( $timestamp_args ); |
| 45 | 45 | |
| 46 | - $timezone_select_args = wp_parse_args( $args['select_timezone'], array( |
|
| 46 | + $timezone_select_args = wp_parse_args( $args[ 'select_timezone' ], array( |
|
| 47 | 47 | 'class' => 'cmb2_select cmb2-select-timezone', |
| 48 | 48 | 'name' => $this->_name( '[timezone]' ), |
| 49 | 49 | 'id' => $this->_id( '_timezone' ), |
| 50 | 50 | 'options' => wp_timezone_choice( $tzstring ), |
| 51 | - 'desc' => $args['desc'], |
|
| 51 | + 'desc' => $args[ 'desc' ], |
|
| 52 | 52 | 'rendered' => true, |
| 53 | 53 | ) ); |
| 54 | 54 | $select = $this->types->select( $timezone_select_args ); |
@@ -22,16 +22,16 @@ discard block |
||
| 22 | 22 | 'timepicker' => array(), |
| 23 | 23 | ) ); |
| 24 | 24 | |
| 25 | - if ( empty( $args['value'] ) ) { |
|
| 26 | - $args['value'] = $field->escaped_value(); |
|
| 25 | + if ( empty( $args[ 'value' ] ) ) { |
|
| 26 | + $args[ 'value' ] = $field->escaped_value(); |
|
| 27 | 27 | // This will be used if there is a select_timezone set for this field |
| 28 | 28 | $tz_offset = $field->field_timezone_offset(); |
| 29 | 29 | if ( ! empty( $tz_offset ) ) { |
| 30 | - $args['value'] -= $tz_offset; |
|
| 30 | + $args[ 'value' ] -= $tz_offset; |
|
| 31 | 31 | } |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | - $has_good_value = ! empty( $args['value'] ) && ! is_array( $args['value'] ); |
|
| 34 | + $has_good_value = ! empty( $args[ 'value' ] ) && ! is_array( $args[ 'value' ] ); |
|
| 35 | 35 | |
| 36 | 36 | $date_input = parent::render( $this->date_args( $args, $has_good_value ) ); |
| 37 | 37 | $time_input = parent::render( $this->time_args( $args, $has_good_value ) ); |
@@ -40,31 +40,31 @@ discard block |
||
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | public function date_args( $args, $has_good_value ) { |
| 43 | - $date_args = wp_parse_args( $args['datepicker'], array( |
|
| 43 | + $date_args = wp_parse_args( $args[ 'datepicker' ], array( |
|
| 44 | 44 | 'class' => 'cmb2-text-small cmb2-datepicker', |
| 45 | 45 | 'name' => $this->_name( '[date]' ), |
| 46 | 46 | 'id' => $this->_id( '_date' ), |
| 47 | - 'value' => $has_good_value ? $this->field->get_timestamp_format( 'date_format', $args['value'] ) : '', |
|
| 47 | + 'value' => $has_good_value ? $this->field->get_timestamp_format( 'date_format', $args[ 'value' ] ) : '', |
|
| 48 | 48 | 'desc' => '', |
| 49 | 49 | ) ); |
| 50 | 50 | |
| 51 | - $date_args['rendered'] = true; |
|
| 51 | + $date_args[ 'rendered' ] = true; |
|
| 52 | 52 | |
| 53 | 53 | // Let's get the date-format, and set it up as a data attr for the field. |
| 54 | 54 | return $this->parse_picker_options( 'date', $date_args ); |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | public function time_args( $args, $has_good_value ) { |
| 58 | - $time_args = wp_parse_args( $args['timepicker'], array( |
|
| 58 | + $time_args = wp_parse_args( $args[ 'timepicker' ], array( |
|
| 59 | 59 | 'class' => 'cmb2-timepicker text-time', |
| 60 | 60 | 'name' => $this->_name( '[time]' ), |
| 61 | 61 | 'id' => $this->_id( '_time' ), |
| 62 | - 'value' => $has_good_value ? $this->field->get_timestamp_format( 'time_format', $args['value'] ) : '', |
|
| 63 | - 'desc' => $args['desc'], |
|
| 62 | + 'value' => $has_good_value ? $this->field->get_timestamp_format( 'time_format', $args[ 'value' ] ) : '', |
|
| 63 | + 'desc' => $args[ 'desc' ], |
|
| 64 | 64 | 'js_dependencies' => array( 'jquery-ui-core', 'jquery-ui-datepicker', 'jquery-ui-datetimepicker' ), |
| 65 | 65 | ) ); |
| 66 | 66 | |
| 67 | - $time_args['rendered'] = true; |
|
| 67 | + $time_args[ 'rendered' ] = true; |
|
| 68 | 68 | |
| 69 | 69 | // Let's get the time-format, and set it up as a data attr for the field. |
| 70 | 70 | return $this->parse_picker_options( 'time', $time_args ); |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | */ |
| 39 | 39 | public function __construct( CMB2_Types $types, $args = array() ) { |
| 40 | 40 | $this->types = $types; |
| 41 | - $args['rendered'] = isset( $args['rendered'] ) ? (bool) $args['rendered'] : true; |
|
| 41 | + $args[ 'rendered' ] = isset( $args[ 'rendered' ] ) ? (bool) $args[ 'rendered' ] : true; |
|
| 42 | 42 | $this->args = $args; |
| 43 | 43 | } |
| 44 | 44 | |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | * @return string|CMB2_Type_Base Rendered output or this object. |
| 57 | 57 | */ |
| 58 | 58 | public function rendered( $rendered ) { |
| 59 | - if ( $this->args['rendered'] ) { |
|
| 59 | + if ( $this->args[ 'rendered' ] ) { |
|
| 60 | 60 | return is_a( $rendered, __CLASS__ ) ? $rendered->rendered : $rendered; |
| 61 | 61 | } |
| 62 | 62 | |
@@ -50,12 +50,12 @@ |
||
| 50 | 50 | 'js_dependencies' => array(), |
| 51 | 51 | ), $args ); |
| 52 | 52 | |
| 53 | - if ( ! empty( $a['js_dependencies'] ) ) { |
|
| 54 | - $this->field->add_js_dependencies( $a['js_dependencies'] ); |
|
| 53 | + if ( ! empty( $a[ 'js_dependencies' ] ) ) { |
|
| 54 | + $this->field->add_js_dependencies( $a[ 'js_dependencies' ] ); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | return $this->rendered( |
| 58 | - sprintf( '<input%s/>%s', $this->concat_attrs( $a, array( 'desc', 'js_dependencies' ) ), $a['desc'] ) |
|
| 58 | + sprintf( '<input%s/>%s', $this->concat_attrs( $a, array( 'desc', 'js_dependencies' ) ), $a[ 'desc' ] ) |
|
| 59 | 59 | ); |
| 60 | 60 | } |
| 61 | 61 | } |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | |
| 173 | 173 | global $wp_locale; |
| 174 | 174 | |
| 175 | - $search = array( $wp_locale->number_format['thousands_sep'], $wp_locale->number_format['decimal_point'] ); |
|
| 175 | + $search = array( $wp_locale->number_format[ 'thousands_sep' ], $wp_locale->number_format[ 'decimal_point' ] ); |
|
| 176 | 176 | $replace = array( '', '.' ); |
| 177 | 177 | |
| 178 | 178 | // for repeatable |
@@ -215,8 +215,8 @@ discard block |
||
| 215 | 215 | return $repeat_value; |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | - if ( isset( $this->value['date'], $this->value['time'] ) ) { |
|
| 219 | - $this->value = $this->field->get_timestamp_from_value( $this->value['date'] . ' ' . $this->value['time'] ); |
|
| 218 | + if ( isset( $this->value[ 'date' ], $this->value[ 'time' ] ) ) { |
|
| 219 | + $this->value = $this->field->get_timestamp_from_value( $this->value[ 'date' ] . ' ' . $this->value[ 'time' ] ); |
|
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | if ( $tz_offset = $this->field->field_timezone_offset() ) { |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | $tzstring = null; |
| 255 | 255 | |
| 256 | 256 | if ( is_array( $this->value ) && array_key_exists( 'timezone', $this->value ) ) { |
| 257 | - $tzstring = $this->value['timezone']; |
|
| 257 | + $tzstring = $this->value[ 'timezone' ]; |
|
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | if ( empty( $tzstring ) ) { |
@@ -274,8 +274,8 @@ discard block |
||
| 274 | 274 | $tzstring = false !== $tzstring ? $tzstring : timezone_name_from_abbr( '', 0, 0 ); |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | - $full_format = $this->field->args['date_format'] . ' ' . $this->field->args['time_format']; |
|
| 278 | - $full_date = $this->value['date'] . ' ' . $this->value['time']; |
|
| 277 | + $full_format = $this->field->args[ 'date_format' ] . ' ' . $this->field->args[ 'time_format' ]; |
|
| 278 | + $full_date = $this->value[ 'date' ] . ' ' . $this->value[ 'time' ]; |
|
| 279 | 279 | |
| 280 | 280 | try { |
| 281 | 281 | |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | } else { |
| 299 | 299 | // Save the utc timestamp supporting field |
| 300 | 300 | if ( $repeat ) { |
| 301 | - $utc_values[ $utc_key ][] = $utc_stamp; |
|
| 301 | + $utc_values[ $utc_key ][ ] = $utc_stamp; |
|
| 302 | 302 | } else { |
| 303 | 303 | $this->_save_utc_value( $utc_key, $utc_stamp ); |
| 304 | 304 | } |
@@ -433,7 +433,7 @@ discard block |
||
| 433 | 433 | if ( $this->value ) { |
| 434 | 434 | $val = $this->$method( true ); |
| 435 | 435 | if ( ! empty( $val ) ) { |
| 436 | - $new_value[] = $val; |
|
| 436 | + $new_value[ ] = $val; |
|
| 437 | 437 | } |
| 438 | 438 | } |
| 439 | 439 | } |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | if ( is_array( $this->field->value ) ) { |
| 125 | 125 | |
| 126 | 126 | // Then loop and output. |
| 127 | - echo '<ul class="cmb2-'. str_replace( '_', '-', $this->field->type() ) .'">'; |
|
| 127 | + echo '<ul class="cmb2-' . str_replace( '_', '-', $this->field->type() ) . '">'; |
|
| 128 | 128 | foreach ( $this->field->value as $val ) { |
| 129 | 129 | $this->value = $val; |
| 130 | 130 | echo '<li>', $this->_display(), '</li>'; |
@@ -197,8 +197,8 @@ discard block |
||
| 197 | 197 | $options = $this->field->options(); |
| 198 | 198 | |
| 199 | 199 | $fallback = $this->field->args( 'show_option_none' ); |
| 200 | - if ( ! $fallback && isset( $options[''] ) ) { |
|
| 201 | - $fallback = $options['']; |
|
| 200 | + if ( ! $fallback && isset( $options[ '' ] ) ) { |
|
| 201 | + $fallback = $options[ '' ]; |
|
| 202 | 202 | } |
| 203 | 203 | if ( ! $this->value && $fallback ) { |
| 204 | 204 | echo $fallback; |
@@ -225,9 +225,9 @@ discard block |
||
| 225 | 225 | $output = array(); |
| 226 | 226 | foreach ( $this->value as $val ) { |
| 227 | 227 | if ( isset( $options[ $val ] ) ) { |
| 228 | - $output[] = $options[ $val ]; |
|
| 228 | + $output[ ] = $options[ $val ]; |
|
| 229 | 229 | } else { |
| 230 | - $output[] = esc_attr( $val ); |
|
| 230 | + $output[ ] = esc_attr( $val ); |
|
| 231 | 231 | } |
| 232 | 232 | } |
| 233 | 233 | |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | * @since 2.2.2 |
| 252 | 252 | */ |
| 253 | 253 | protected function _display() { |
| 254 | - echo '<xmp class="cmb2-code">'. print_r( $this->value, true ) .'</xmp>'; |
|
| 254 | + echo '<xmp class="cmb2-code">' . print_r( $this->value, true ) . '</xmp>'; |
|
| 255 | 255 | } |
| 256 | 256 | } |
| 257 | 257 | |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | if ( $datetime && $datetime instanceof DateTime ) { |
| 294 | 294 | $tz = $datetime->getTimezone(); |
| 295 | 295 | $tzstring = $tz->getName(); |
| 296 | - $this->value = $datetime->getTimestamp(); |
|
| 296 | + $this->value = $datetime->getTimestamp(); |
|
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | $date = $this->field->get_timestamp_format( 'date_format', $this->value ); |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | if ( is_wp_error( $terms ) || empty( $terms ) && ( $default = $this->field->get_default() ) ) { |
| 318 | 318 | $term = get_term_by( 'slug', $default, $taxonomy ); |
| 319 | 319 | } elseif ( ! empty( $terms ) ) { |
| 320 | - $term = $terms[key( $terms )]; |
|
| 320 | + $term = $terms[ key( $terms ) ]; |
|
| 321 | 321 | } |
| 322 | 322 | |
| 323 | 323 | if ( $term ) { |
@@ -341,10 +341,10 @@ discard block |
||
| 341 | 341 | $terms = array(); |
| 342 | 342 | if ( is_array( $default ) ) { |
| 343 | 343 | foreach ( $default as $slug ) { |
| 344 | - $terms[] = get_term_by( 'slug', $slug, $taxonomy ); |
|
| 344 | + $terms[ ] = get_term_by( 'slug', $slug, $taxonomy ); |
|
| 345 | 345 | } |
| 346 | 346 | } else { |
| 347 | - $terms[] = get_term_by( 'slug', $default, $taxonomy ); |
|
| 347 | + $terms[ ] = get_term_by( 'slug', $default, $taxonomy ); |
|
| 348 | 348 | } |
| 349 | 349 | } |
| 350 | 350 | |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | $links = array(); |
| 354 | 354 | foreach ( $terms as $term ) { |
| 355 | 355 | $link = get_edit_term_link( $term->term_id, $taxonomy ); |
| 356 | - $links[] = '<a href="'. esc_url( $link ) .'">'. esc_html( $term->name ) .'</a>'; |
|
| 356 | + $links[ ] = '<a href="' . esc_url( $link ) . '">' . esc_html( $term->name ) . '</a>'; |
|
| 357 | 357 | } |
| 358 | 358 | // Then loop and output. |
| 359 | 359 | echo '<div class="cmb2-taxonomy-terms-', esc_attr( $taxonomy ), '">'; |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | if ( $id ) { |
| 397 | 397 | $image = wp_get_attachment_image( $id, $img_size, null, array( 'class' => 'cmb-image-display' ) ); |
| 398 | 398 | } else { |
| 399 | - $size = is_array( $img_size ) ? $img_size[0] : 200; |
|
| 399 | + $size = is_array( $img_size ) ? $img_size[ 0 ] : 200; |
|
| 400 | 400 | $image = '<img class="cmb-image-display" style="max-width: ' . absint( $size ) . 'px; width: 100%; height: auto;" src="' . $url_value . '" alt="" />'; |
| 401 | 401 | } |
| 402 | 402 | |
@@ -86,18 +86,18 @@ discard block |
||
| 86 | 86 | $oembed = cmb2_ajax()->get_oembed_no_edit( $args ); |
| 87 | 87 | |
| 88 | 88 | // Send back our embed |
| 89 | - if ( $oembed['embed'] && $oembed['embed'] != $oembed['fallback'] ) { |
|
| 90 | - return '<div class="cmb2-oembed">' . $oembed['embed'] . '</div>'; |
|
| 89 | + if ( $oembed[ 'embed' ] && $oembed[ 'embed' ] != $oembed[ 'fallback' ] ) { |
|
| 90 | + return '<div class="cmb2-oembed">' . $oembed[ 'embed' ] . '</div>'; |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | $error = sprintf( |
| 94 | 94 | /* translators: 1: results for. 2: link to codex.wordpress.org/Embeds */ |
| 95 | 95 | esc_html__( 'No oEmbed Results Found for %1$s. View more info at %2$s.', 'cmb2' ), |
| 96 | - $oembed['fallback'], |
|
| 96 | + $oembed[ 'fallback' ], |
|
| 97 | 97 | '<a href="https://codex.wordpress.org/Embeds" target="_blank">codex.wordpress.org/Embeds</a>' |
| 98 | 98 | ); |
| 99 | 99 | |
| 100 | - if ( isset( $args['wp_error'] ) && $args['wp_error'] ) { |
|
| 100 | + if ( isset( $args[ 'wp_error' ] ) && $args[ 'wp_error' ] ) { |
|
| 101 | 101 | return new WP_Error( 'cmb2_get_oembed_result', $wp_error, compact( 'oembed', 'args' ) ); |
| 102 | 102 | } |
| 103 | 103 | |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | $cmb = CMB2_Boxes::get( $meta_box ); |
| 213 | 213 | } else { |
| 214 | 214 | // See if we already have an instance of this metabox |
| 215 | - $cmb = CMB2_Boxes::get( $meta_box['id'] ); |
|
| 215 | + $cmb = CMB2_Boxes::get( $meta_box[ 'id' ] ); |
|
| 216 | 216 | // If not, we'll initate a new metabox |
| 217 | 217 | $cmb = $cmb ? $cmb : new CMB2( $meta_box, $object_id ); |
| 218 | 218 | } |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | ) ); |
| 289 | 289 | |
| 290 | 290 | // Set object type explicitly (rather than trying to guess from context) |
| 291 | - $cmb->object_type( $args['object_type'] ); |
|
| 291 | + $cmb->object_type( $args[ 'object_type' ] ); |
|
| 292 | 292 | |
| 293 | 293 | // Save the metabox if it's been submitted |
| 294 | 294 | // check permissions |
@@ -296,32 +296,32 @@ discard block |
||
| 296 | 296 | if ( |
| 297 | 297 | $cmb->prop( 'save_fields' ) |
| 298 | 298 | // check nonce |
| 299 | - && isset( $_POST['submit-cmb'], $_POST['object_id'], $_POST[ $cmb->nonce() ] ) |
|
| 299 | + && isset( $_POST[ 'submit-cmb' ], $_POST[ 'object_id' ], $_POST[ $cmb->nonce() ] ) |
|
| 300 | 300 | && wp_verify_nonce( $_POST[ $cmb->nonce() ], $cmb->nonce() ) |
| 301 | - && $object_id && $_POST['object_id'] == $object_id |
|
| 301 | + && $object_id && $_POST[ 'object_id' ] == $object_id |
|
| 302 | 302 | ) { |
| 303 | 303 | $cmb->save_fields( $object_id, $cmb->object_type(), $_POST ); |
| 304 | 304 | } |
| 305 | 305 | |
| 306 | 306 | // Enqueue JS/CSS |
| 307 | - if ( $args['cmb_styles'] ) { |
|
| 307 | + if ( $args[ 'cmb_styles' ] ) { |
|
| 308 | 308 | CMB2_hookup::enqueue_cmb_css(); |
| 309 | 309 | } |
| 310 | 310 | |
| 311 | - if ( $args['enqueue_js'] ) { |
|
| 311 | + if ( $args[ 'enqueue_js' ] ) { |
|
| 312 | 312 | CMB2_hookup::enqueue_cmb_js(); |
| 313 | 313 | } |
| 314 | 314 | |
| 315 | - $form_format = apply_filters( 'cmb2_get_metabox_form_format', $args['form_format'], $object_id, $cmb ); |
|
| 315 | + $form_format = apply_filters( 'cmb2_get_metabox_form_format', $args[ 'form_format' ], $object_id, $cmb ); |
|
| 316 | 316 | |
| 317 | 317 | $format_parts = explode( '%3$s', $form_format ); |
| 318 | 318 | |
| 319 | 319 | // Show cmb form |
| 320 | - printf( $format_parts[0], $cmb->cmb_id, $object_id ); |
|
| 320 | + printf( $format_parts[ 0 ], $cmb->cmb_id, $object_id ); |
|
| 321 | 321 | $cmb->show_form(); |
| 322 | 322 | |
| 323 | - if ( isset( $format_parts[1] ) && $format_parts[1] ) { |
|
| 324 | - printf( str_ireplace( '%4$s', '%1$s', $format_parts[1] ), $args['save_button'] ); |
|
| 323 | + if ( isset( $format_parts[ 1 ] ) && $format_parts[ 1 ] ) { |
|
| 324 | + printf( str_ireplace( '%4$s', '%1$s', $format_parts[ 1 ] ), $args[ 'save_button' ] ); |
|
| 325 | 325 | } |
| 326 | 326 | |
| 327 | 327 | } |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | * @param array $args Optional arguments array |
| 335 | 335 | */ |
| 336 | 336 | function cmb2_metabox_form( $meta_box, $object_id = 0, $args = array() ) { |
| 337 | - if ( ! isset( $args['echo'] ) || $args['echo'] ) { |
|
| 337 | + if ( ! isset( $args[ 'echo' ] ) || $args[ 'echo' ] ) { |
|
| 338 | 338 | cmb2_print_metabox_form( $meta_box, $object_id, $args ); |
| 339 | 339 | } else { |
| 340 | 340 | return cmb2_get_metabox_form( $meta_box, $object_id, $args ); |
@@ -356,7 +356,7 @@ discard block |
||
| 356 | 356 | |
| 357 | 357 | $schedule_format = str_replace( |
| 358 | 358 | array( 'M', 'Y', 'm', 'd', 'H', 'i', 'a' ), |
| 359 | - array('%b', '%Y', '%m', '%d', '%H', '%M', '%p' ), |
|
| 359 | + array( '%b', '%Y', '%m', '%d', '%H', '%M', '%p' ), |
|
| 360 | 360 | $date_format |
| 361 | 361 | ); |
| 362 | 362 | |
@@ -373,14 +373,14 @@ discard block |
||
| 373 | 373 | * 4 or 2 characters, as needed |
| 374 | 374 | */ |
| 375 | 375 | '%04d-%02d-%02d %02d:%02d:%02d', |
| 376 | - $parsed_time['tm_year'] + 1900, // This will be "111", so we need to add 1900. |
|
| 377 | - $parsed_time['tm_mon'] + 1, // This will be the month minus one, so we add one. |
|
| 378 | - $parsed_time['tm_mday'], |
|
| 379 | - $parsed_time['tm_hour'], |
|
| 380 | - $parsed_time['tm_min'], |
|
| 381 | - $parsed_time['tm_sec'] |
|
| 376 | + $parsed_time[ 'tm_year' ] + 1900, // This will be "111", so we need to add 1900. |
|
| 377 | + $parsed_time[ 'tm_mon' ] + 1, // This will be the month minus one, so we add one. |
|
| 378 | + $parsed_time[ 'tm_mday' ], |
|
| 379 | + $parsed_time[ 'tm_hour' ], |
|
| 380 | + $parsed_time[ 'tm_min' ], |
|
| 381 | + $parsed_time[ 'tm_sec' ] |
|
| 382 | 382 | ); |
| 383 | 383 | |
| 384 | - return new DateTime($ymd); |
|
| 384 | + return new DateTime( $ymd ); |
|
| 385 | 385 | } |
| 386 | 386 | } |