Completed
Pull Request — trunk (#541)
by Justin
07:19
created
includes/CMB2_REST_Controller_Boxes.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 		foreach ( CMB2_REST::$boxes as $this->rest_box ) {
88 88
 			if ( $this->rest_box->rest_read ) {
89 89
 				$rest_box = $this->get_rest_box();
90
-				$boxes_data[ $this->rest_box->cmb->cmb_id ] = $this->server->response_to_data( $rest_box, isset( $this->request['_embed'] ) );
90
+				$boxes_data[ $this->rest_box->cmb->cmb_id ] = $this->server->response_to_data( $rest_box, isset( $this->request[ '_embed' ] ) );
91 91
 			}
92 92
 		}
93 93
 
@@ -124,9 +124,9 @@  discard block
 block discarded – undo
124 124
 
125 125
 		$boxes_data = $cmb->meta_box;
126 126
 
127
-		if ( isset( $this->request['_rendered'] ) && $this->namespace_base !== CMB2_REST_Controller::get_intial_route() ) {
128
-			$boxes_data['form_open'] = $this->get_cb_results( array( $cmb, 'render_form_open' ) );
129
-			$boxes_data['form_close'] = $this->get_cb_results( array( $cmb, 'render_form_close' ) );
127
+		if ( isset( $this->request[ '_rendered' ] ) && $this->namespace_base !== CMB2_REST_Controller::get_intial_route() ) {
128
+			$boxes_data[ 'form_open' ] = $this->get_cb_results( array( $cmb, 'render_form_open' ) );
129
+			$boxes_data[ 'form_close' ] = $this->get_cb_results( array( $cmb, 'render_form_close' ) );
130 130
 
131 131
 			global $wp_scripts, $wp_styles;
132 132
 			$before_css = $wp_styles->queue;
@@ -134,15 +134,15 @@  discard block
 block discarded – undo
134 134
 
135 135
 			CMB2_JS::enqueue();
136 136
 
137
-			$boxes_data['js_dependencies'] = array_values( array_diff( $wp_scripts->queue, $before_js ) );
138
-			$boxes_data['css_dependencies'] = array_values( array_diff( $wp_styles->queue, $before_css ) );
137
+			$boxes_data[ 'js_dependencies' ] = array_values( array_diff( $wp_scripts->queue, $before_js ) );
138
+			$boxes_data[ 'css_dependencies' ] = array_values( array_diff( $wp_styles->queue, $before_css ) );
139 139
 		}
140 140
 
141 141
 		// TODO: look into 'embed' parameter.
142 142
 		// http://demo.wp-api.org/wp-json/wp/v2/posts?_embed
143
-		unset( $boxes_data['fields'] );
143
+		unset( $boxes_data[ 'fields' ] );
144 144
 		// Handle callable properties.
145
-		unset( $boxes_data['show_on_cb'] );
145
+		unset( $boxes_data[ 'show_on_cb' ] );
146 146
 
147 147
 		$response = rest_ensure_response( $boxes_data );
148 148
 
Please login to merge, or discard this patch.