|
@@ -88,7 +88,7 @@ discard block |
|
|
block discarded – undo |
|
88
|
88
|
foreach ( $boxes as $this->rest_box ) { |
|
89
|
89
|
if ( $this->rest_box->rest_read ) { |
|
90
|
90
|
$rest_box = $this->get_rest_box(); |
|
91
|
|
- $boxes_data[] = $this->server->response_to_data( $rest_box, isset( $this->request['_embed'] ) ); |
|
|
91
|
+ $boxes_data[ ] = $this->server->response_to_data( $rest_box, isset( $this->request[ '_embed' ] ) ); |
|
92
|
92
|
} |
|
93
|
93
|
} |
|
94
|
94
|
|
|
@@ -125,9 +125,9 @@ discard block |
|
|
block discarded – undo |
|
125
|
125
|
|
|
126
|
126
|
$boxes_data = $cmb->meta_box; |
|
127
|
127
|
|
|
128
|
|
- if ( isset( $this->request['_rendered'] ) && $this->namespace_base !== CMB2_REST_Controller::get_intial_route() ) { |
|
129
|
|
- $boxes_data['form_open'] = $this->get_cb_results( array( $cmb, 'render_form_open' ) ); |
|
130
|
|
- $boxes_data['form_close'] = $this->get_cb_results( array( $cmb, 'render_form_close' ) ); |
|
|
128
|
+ if ( isset( $this->request[ '_rendered' ] ) && $this->namespace_base !== CMB2_REST_Controller::get_intial_route() ) { |
|
|
129
|
+ $boxes_data[ 'form_open' ] = $this->get_cb_results( array( $cmb, 'render_form_open' ) ); |
|
|
130
|
+ $boxes_data[ 'form_close' ] = $this->get_cb_results( array( $cmb, 'render_form_close' ) ); |
|
131
|
131
|
|
|
132
|
132
|
global $wp_scripts, $wp_styles; |
|
133
|
133
|
$before_css = $wp_styles->queue; |
|
@@ -135,15 +135,15 @@ discard block |
|
|
block discarded – undo |
|
135
|
135
|
|
|
136
|
136
|
CMB2_JS::enqueue(); |
|
137
|
137
|
|
|
138
|
|
- $boxes_data['js_dependencies'] = array_values( array_diff( $wp_scripts->queue, $before_js ) ); |
|
139
|
|
- $boxes_data['css_dependencies'] = array_values( array_diff( $wp_styles->queue, $before_css ) ); |
|
|
138
|
+ $boxes_data[ 'js_dependencies' ] = array_values( array_diff( $wp_scripts->queue, $before_js ) ); |
|
|
139
|
+ $boxes_data[ 'css_dependencies' ] = array_values( array_diff( $wp_styles->queue, $before_css ) ); |
|
140
|
140
|
} |
|
141
|
141
|
|
|
142
|
142
|
// TODO: look into 'embed' parameter. |
|
143
|
143
|
// http://demo.wp-api.org/wp-json/wp/v2/posts?_embed |
|
144
|
|
- unset( $boxes_data['fields'] ); |
|
|
144
|
+ unset( $boxes_data[ 'fields' ] ); |
|
145
|
145
|
// Handle callable properties. |
|
146
|
|
- unset( $boxes_data['show_on_cb'] ); |
|
|
146
|
+ unset( $boxes_data[ 'show_on_cb' ] ); |
|
147
|
147
|
|
|
148
|
148
|
$response = rest_ensure_response( $boxes_data ); |
|
149
|
149
|
|