This commit is contained in:
Chung Pham
2020-08-20 17:31:10 +07:00
parent a2415271a9
commit 8851716ddc
34 changed files with 5463 additions and 5035 deletions

View File

@@ -254,7 +254,7 @@ abstract class CMB2_REST_Controller extends WP_REST_Controller {
$this->initiate_rest_box( $request, $request_type );
if ( ! is_wp_error( $this->rest_box ) && ! $this->rest_box->rest_read ) {
$this->rest_box = new WP_Error( 'cmb2_rest_no_read_error', esc_html__( 'This box does not have read permissions.', 'cmb2' ), array(
$this->rest_box = new WP_Error( 'cmb2_rest_no_read_error', esc_html__( 'This box does not have read permissions.', 'opalestate-pro' ), array(
'status' => 403,
) );
}
@@ -274,7 +274,7 @@ abstract class CMB2_REST_Controller extends WP_REST_Controller {
$this->initiate_rest_box( $request, $request_type );
if ( ! is_wp_error( $this->rest_box ) && ! $this->rest_box->rest_edit ) {
$this->rest_box = new WP_Error( 'cmb2_rest_no_write_error', esc_html__( 'This box does not have write permissions.', 'cmb2' ), array(
$this->rest_box = new WP_Error( 'cmb2_rest_no_write_error', esc_html__( 'This box does not have write permissions.', 'opalestate-pro' ), array(
'status' => 403,
) );
}
@@ -297,7 +297,7 @@ abstract class CMB2_REST_Controller extends WP_REST_Controller {
if ( ! $this->rest_box ) {
$this->rest_box = new WP_Error( 'cmb2_rest_box_not_found_error', esc_html__( 'No box found by that id. A box needs to be registered with the "show_in_rest" parameter configured.', 'cmb2' ), array(
$this->rest_box = new WP_Error( 'cmb2_rest_box_not_found_error', esc_html__( 'No box found by that id. A box needs to be registered with the "show_in_rest" parameter configured.', 'opalestate-pro' ), array(
'status' => 403,
) );
@@ -375,21 +375,21 @@ abstract class CMB2_REST_Controller extends WP_REST_Controller {
'type' => 'object',
'properties' => array(
'description' => array(
'description' => esc_html__( 'A human-readable description of the object.', 'cmb2' ),
'description' => esc_html__( 'A human-readable description of the object.', 'opalestate-pro' ),
'type' => 'string',
'context' => array(
'view',
),
),
'name' => array(
'description' => esc_html__( 'The id for the object.', 'cmb2' ),
'description' => esc_html__( 'The id for the object.', 'opalestate-pro' ),
'type' => 'integer',
'context' => array(
'view',
),
),
'name' => array(
'description' => esc_html__( 'The title for the object.', 'cmb2' ),
'description' => esc_html__( 'The title for the object.', 'opalestate-pro' ),
'type' => 'string',
'context' => array(
'view',

View File

@@ -48,7 +48,7 @@ class CMB2_REST_Controller_Boxes extends CMB2_REST_Controller {
public function register_routes() {
$args = array(
'_embed' => array(
'description' => esc_html__( 'Includes the registered fields for the box in the response.', 'cmb2' ),
'description' => esc_html__( 'Includes the registered fields for the box in the response.', 'opalestate-pro' ),
),
);
@@ -69,7 +69,7 @@ class CMB2_REST_Controller_Boxes extends CMB2_REST_Controller {
) );
$args['_rendered'] = array(
'description' => esc_html__( 'Includes the fully rendered attributes, \'form_open\', \'form_close\', as well as the enqueued \'js_dependencies\' script handles, and \'css_dependencies\' stylesheet handles.', 'cmb2' ),
'description' => esc_html__( 'Includes the fully rendered attributes, \'form_open\', \'form_close\', as well as the enqueued \'js_dependencies\' script handles, and \'css_dependencies\' stylesheet handles.', 'opalestate-pro' ),
);
// Returns specific box's data.
@@ -119,7 +119,7 @@ class CMB2_REST_Controller_Boxes extends CMB2_REST_Controller {
$boxes = CMB2_REST::get_all();
if ( empty( $boxes ) ) {
return new WP_Error( 'cmb2_rest_no_boxes', esc_html__( 'No boxes found.', 'cmb2' ), array(
return new WP_Error( 'cmb2_rest_no_boxes', esc_html__( 'No boxes found.', 'opalestate-pro' ), array(
'status' => 403,
) );
}

View File

@@ -24,16 +24,16 @@ class CMB2_REST_Controller_Fields extends CMB2_REST_Controller_Boxes {
public function register_routes() {
$args = array(
'_embed' => array(
'description' => esc_html__( 'Includes the box object which the fields are registered to in the response.', 'cmb2' ),
'description' => esc_html__( 'Includes the box object which the fields are registered to in the response.', 'opalestate-pro' ),
),
'_rendered' => array(
'description' => esc_html__( 'When the \'_rendered\' argument is passed, the renderable field attributes will be returned fully rendered. By default, the names of the callback handers for the renderable attributes will be returned.', 'cmb2' ),
'description' => esc_html__( 'When the \'_rendered\' argument is passed, the renderable field attributes will be returned fully rendered. By default, the names of the callback handers for the renderable attributes will be returned.', 'opalestate-pro' ),
),
'object_id' => array(
'description' => esc_html__( 'To view or modify the field\'s value, the \'object_id\' and \'object_type\' arguments are required.', 'cmb2' ),
'description' => esc_html__( 'To view or modify the field\'s value, the \'object_id\' and \'object_type\' arguments are required.', 'opalestate-pro' ),
),
'object_type' => array(
'description' => esc_html__( 'To view or modify the field\'s value, the \'object_id\' and \'object_type\' arguments are required.', 'cmb2' ),
'description' => esc_html__( 'To view or modify the field\'s value, the \'object_id\' and \'object_type\' arguments are required.', 'opalestate-pro' ),
),
);
@@ -233,7 +233,7 @@ class CMB2_REST_Controller_Fields extends CMB2_REST_Controller_Boxes {
$this->initiate_rest_read_box( $request, 'field_value_update' );
if ( ! $this->request['value'] ) {
return new WP_Error( 'cmb2_rest_update_field_error', esc_html__( 'CMB2 Field value cannot be updated without the value parameter specified.', 'cmb2' ), array(
return new WP_Error( 'cmb2_rest_update_field_error', esc_html__( 'CMB2 Field value cannot be updated without the value parameter specified.', 'opalestate-pro' ), array(
'status' => 400,
) );
}
@@ -294,7 +294,7 @@ class CMB2_REST_Controller_Fields extends CMB2_REST_Controller_Boxes {
public function modify_field_value( $activity ) {
if ( ! $this->request['object_id'] || ! $this->request['object_type'] ) {
return new WP_Error( 'cmb2_rest_modify_field_value_error', esc_html__( 'CMB2 Field value cannot be modified without the object_id and object_type parameters specified.', 'cmb2' ), array(
return new WP_Error( 'cmb2_rest_modify_field_value_error', esc_html__( 'CMB2 Field value cannot be modified without the object_id and object_type parameters specified.', 'opalestate-pro' ), array(
'status' => 400,
) );
}
@@ -309,7 +309,7 @@ class CMB2_REST_Controller_Fields extends CMB2_REST_Controller_Boxes {
);
if ( ! $this->field ) {
return new WP_Error( 'cmb2_rest_no_field_by_id_error', esc_html__( 'No field found by that id.', 'cmb2' ), array(
return new WP_Error( 'cmb2_rest_no_field_by_id_error', esc_html__( 'No field found by that id.', 'opalestate-pro' ), array(
'status' => 403,
) );
}
@@ -338,7 +338,7 @@ class CMB2_REST_Controller_Fields extends CMB2_REST_Controller_Boxes {
$this->field = $this->rest_box->field_can_read( $field, true );
if ( ! $this->field ) {
return new WP_Error( 'cmb2_rest_no_field_by_id_error', esc_html__( 'No field found by that id.', 'cmb2' ), array(
return new WP_Error( 'cmb2_rest_no_field_by_id_error', esc_html__( 'No field found by that id.', 'opalestate-pro' ), array(
'status' => 403,
) );
}
@@ -412,7 +412,7 @@ class CMB2_REST_Controller_Fields extends CMB2_REST_Controller_Boxes {
if ( empty( $value ) || is_scalar( $value ) || is_array( $value ) ) {
$field_data[ $key ] = $value;
} else {
$field_data[ $key ] = sprintf( esc_html__( 'Value Error for %s', 'cmb2' ), $key );
$field_data[ $key ] = sprintf( esc_html__( 'Value Error for %s', 'opalestate-pro' ), $key );
}
}