@@ -86,13 +86,13 @@ 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 | - $error = sprintf( __( 'No oEmbed Results Found for %s. View more info at %s.', 'cmb2' ), $oembed['fallback'], ' <a href="http://codex.wordpress.org/Embeds" target="_blank">codex.wordpress.org/Embeds</a>' ); |
|
93 | + $error = sprintf( __( 'No oEmbed Results Found for %s. View more info at %s.', 'cmb2' ), $oembed[ 'fallback' ], ' <a href="http://codex.wordpress.org/Embeds" target="_blank">codex.wordpress.org/Embeds</a>' ); |
|
94 | 94 | |
95 | - if ( isset( $args['wp_error'] ) && $args['wp_error'] ) { |
|
95 | + if ( isset( $args[ 'wp_error' ] ) && $args[ 'wp_error' ] ) { |
|
96 | 96 | return new WP_Error( 'cmb2_get_oembed_result', $wp_error, compact( 'oembed', 'args' ) ); |
97 | 97 | } |
98 | 98 | |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | $cmb = CMB2_Boxes::get( $meta_box ); |
208 | 208 | } else { |
209 | 209 | // See if we already have an instance of this metabox |
210 | - $cmb = CMB2_Boxes::get( $meta_box['id'] ); |
|
210 | + $cmb = CMB2_Boxes::get( $meta_box[ 'id' ] ); |
|
211 | 211 | // If not, we'll initate a new metabox |
212 | 212 | $cmb = $cmb ? $cmb : new CMB2( $meta_box, $object_id ); |
213 | 213 | } |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | ) ); |
284 | 284 | |
285 | 285 | // Set object type explicitly (rather than trying to guess from context) |
286 | - $cmb->object_type( $args['object_type'] ); |
|
286 | + $cmb->object_type( $args[ 'object_type' ] ); |
|
287 | 287 | |
288 | 288 | // Save the metabox if it's been submitted |
289 | 289 | // check permissions |
@@ -291,32 +291,32 @@ discard block |
||
291 | 291 | if ( |
292 | 292 | $cmb->prop( 'save_fields' ) |
293 | 293 | // check nonce |
294 | - && isset( $_POST['submit-cmb'], $_POST['object_id'], $_POST[ $cmb->nonce() ] ) |
|
294 | + && isset( $_POST[ 'submit-cmb' ], $_POST[ 'object_id' ], $_POST[ $cmb->nonce() ] ) |
|
295 | 295 | && wp_verify_nonce( $_POST[ $cmb->nonce() ], $cmb->nonce() ) |
296 | - && $object_id && $_POST['object_id'] == $object_id |
|
296 | + && $object_id && $_POST[ 'object_id' ] == $object_id |
|
297 | 297 | ) { |
298 | 298 | $cmb->save_fields( $object_id, $cmb->object_type(), $_POST ); |
299 | 299 | } |
300 | 300 | |
301 | 301 | // Enqueue JS/CSS |
302 | - if ( $args['cmb_styles'] ) { |
|
302 | + if ( $args[ 'cmb_styles' ] ) { |
|
303 | 303 | CMB2_hookup::enqueue_cmb_css(); |
304 | 304 | } |
305 | 305 | |
306 | - if ( $args['enqueue_js'] ) { |
|
306 | + if ( $args[ 'enqueue_js' ] ) { |
|
307 | 307 | CMB2_hookup::enqueue_cmb_js(); |
308 | 308 | } |
309 | 309 | |
310 | - $form_format = apply_filters( 'cmb2_get_metabox_form_format', $args['form_format'], $object_id, $cmb ); |
|
310 | + $form_format = apply_filters( 'cmb2_get_metabox_form_format', $args[ 'form_format' ], $object_id, $cmb ); |
|
311 | 311 | |
312 | 312 | $format_parts = explode( '%3$s', $form_format ); |
313 | 313 | |
314 | 314 | // Show cmb form |
315 | - printf( $format_parts[0], $cmb->cmb_id, $object_id ); |
|
315 | + printf( $format_parts[ 0 ], $cmb->cmb_id, $object_id ); |
|
316 | 316 | $cmb->show_form(); |
317 | 317 | |
318 | - if ( isset( $format_parts[1] ) && $format_parts[1] ) { |
|
319 | - printf( str_ireplace( '%4$s', '%1$s', $format_parts[1] ), $args['save_button'] ); |
|
318 | + if ( isset( $format_parts[ 1 ] ) && $format_parts[ 1 ] ) { |
|
319 | + printf( str_ireplace( '%4$s', '%1$s', $format_parts[ 1 ] ), $args[ 'save_button' ] ); |
|
320 | 320 | } |
321 | 321 | |
322 | 322 | } |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | * @param array $args Optional arguments array |
330 | 330 | */ |
331 | 331 | function cmb2_metabox_form( $meta_box, $object_id = 0, $args = array() ) { |
332 | - if ( ! isset( $args['echo'] ) || $args['echo'] ) { |
|
332 | + if ( ! isset( $args[ 'echo' ] ) || $args[ 'echo' ] ) { |
|
333 | 333 | cmb2_print_metabox_form( $meta_box, $object_id, $args ); |
334 | 334 | } else { |
335 | 335 | return cmb2_get_metabox_form( $meta_box, $object_id, $args ); |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | |
352 | 352 | $schedule_format = str_replace( |
353 | 353 | array( 'M', 'Y', 'm', 'd', 'H', 'i', 'a' ), |
354 | - array('%b', '%Y', '%m', '%d', '%H', '%M', '%p' ), |
|
354 | + array( '%b', '%Y', '%m', '%d', '%H', '%M', '%p' ), |
|
355 | 355 | $date_format |
356 | 356 | ); |
357 | 357 | |
@@ -368,14 +368,14 @@ discard block |
||
368 | 368 | * 4 or 2 characters, as needed |
369 | 369 | */ |
370 | 370 | '%04d-%02d-%02d %02d:%02d:%02d', |
371 | - $parsed_time['tm_year'] + 1900, // This will be "111", so we need to add 1900. |
|
372 | - $parsed_time['tm_mon'] + 1, // This will be the month minus one, so we add one. |
|
373 | - $parsed_time['tm_mday'], |
|
374 | - $parsed_time['tm_hour'], |
|
375 | - $parsed_time['tm_min'], |
|
376 | - $parsed_time['tm_sec'] |
|
371 | + $parsed_time[ 'tm_year' ] + 1900, // This will be "111", so we need to add 1900. |
|
372 | + $parsed_time[ 'tm_mon' ] + 1, // This will be the month minus one, so we add one. |
|
373 | + $parsed_time[ 'tm_mday' ], |
|
374 | + $parsed_time[ 'tm_hour' ], |
|
375 | + $parsed_time[ 'tm_min' ], |
|
376 | + $parsed_time[ 'tm_sec' ] |
|
377 | 377 | ); |
378 | 378 | |
379 | - return new DateTime($ymd); |
|
379 | + return new DateTime( $ymd ); |
|
380 | 380 | } |
381 | 381 | } |