Completed
Pull Request — trunk (#708)
by Justin
06:47
created
includes/types/CMB2_Type_Text_Datetime_Timestamp.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -22,16 +22,16 @@  discard block
 block discarded – undo
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
-			$tz_offset = $field->field_timezone_offset( $args['value'] );
28
+			$tz_offset = $field->field_timezone_offset( $args[ 'value' ] );
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
 block discarded – undo
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 );
Please login to merge, or discard this patch.