@@ 246-252 (lines=7) @@ | ||
243 | * |
|
244 | * @return void |
|
245 | */ |
|
246 | protected function initiate_rest_read_box( $request, $request_type ) { |
|
247 | $this->initiate_rest_box( $request, $request_type ); |
|
248 | ||
249 | if ( ! is_wp_error( $this->rest_box ) && ! $this->rest_box->rest_read ) { |
|
250 | $this->rest_box = new WP_Error( 'cmb2_rest_no_read_error', __( 'This box does not have read permissions.', 'cmb2' ), array( 'status' => 403 ) ); |
|
251 | } |
|
252 | } |
|
253 | ||
254 | /** |
|
255 | * Initiates the request property and the rest_box property if box is writeable. |
|
@@ 264-270 (lines=7) @@ | ||
261 | * |
|
262 | * @return void |
|
263 | */ |
|
264 | protected function initiate_rest_edit_box( $request, $request_type ) { |
|
265 | $this->initiate_rest_box( $request, $request_type ); |
|
266 | ||
267 | if ( ! is_wp_error( $this->rest_box ) && ! $this->rest_box->rest_edit ) { |
|
268 | $this->rest_box = new WP_Error( 'cmb2_rest_no_write_error', __( 'This box does not have write permissions.', 'cmb2' ), array( 'status' => 403 ) ); |
|
269 | } |
|
270 | } |
|
271 | ||
272 | /** |
|
273 | * Initiates the request property and the rest_box property. |