@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | /** |
| 153 | 153 | * Handler for updating custom field data. |
| 154 | 154 | * @since 2.2.0 |
| 155 | - * @param mixed $value The value of the field |
|
| 155 | + * @param mixed $values The value of the field |
|
| 156 | 156 | * @param object $object The object from the response |
| 157 | 157 | * @param string $field_id Name of field |
| 158 | 158 | * @return bool|int |
@@ -233,6 +233,9 @@ discard block |
||
| 233 | 233 | return $protected; |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | + /** |
|
| 237 | + * @param string $field_id |
|
| 238 | + */ |
|
| 236 | 239 | public function field_can_update( $field_id ) { |
| 237 | 240 | |
| 238 | 241 | $field = $this->cmb->get_field( $field_id ); |
@@ -620,7 +620,7 @@ discard block |
||
| 620 | 620 | /** |
| 621 | 621 | * Save a repeatable group |
| 622 | 622 | * @since 1.x.x |
| 623 | - * @param array $field_group CMB2_Field group field object |
|
| 623 | + * @param CMB2_Field $field_group CMB2_Field group field object |
|
| 624 | 624 | * @return mixed Return of CMB2_Field::update_data() |
| 625 | 625 | */ |
| 626 | 626 | public function save_group_field( $field_group ) { |
@@ -910,7 +910,7 @@ discard block |
||
| 910 | 910 | * @param mixed $field_id Field (or group field) ID |
| 911 | 911 | * @param mixed $field_args Array of field arguments |
| 912 | 912 | * @param mixed $sub_field_id Sub field ID (if field_group exists) |
| 913 | - * @param mixed $field_group If a sub-field, will be the parent group CMB2_Field object |
|
| 913 | + * @param CMB2_Field|null $field_group If a sub-field, will be the parent group CMB2_Field object |
|
| 914 | 914 | * @return array Array of CMB2_Field arguments |
| 915 | 915 | */ |
| 916 | 916 | public function get_field_args( $field_id, $field_args, $sub_field_id, $field_group ) { |
@@ -969,7 +969,7 @@ discard block |
||
| 969 | 969 | * @since 2.0.0 |
| 970 | 970 | * @param array $field Metabox field config array |
| 971 | 971 | * @param int $position (optional) Position of metabox. 1 for first, etc |
| 972 | - * @return mixed Field id or false |
|
| 972 | + * @return string Field id or false |
|
| 973 | 973 | */ |
| 974 | 974 | public function add_field( array $field, $position = 0 ) { |
| 975 | 975 | if ( ! is_array( $field ) || ! array_key_exists( 'id', $field ) ) { |
@@ -94,7 +94,6 @@ discard block |
||
| 94 | 94 | * |
| 95 | 95 | * @since 2.2.0 |
| 96 | 96 | * |
| 97 | - * @param mixed $data |
|
| 98 | 97 | * @return array $data |
| 99 | 98 | */ |
| 100 | 99 | public function prepare_item( $post ) { |
@@ -107,7 +106,7 @@ discard block |
||
| 107 | 106 | * @since 2.2.0 |
| 108 | 107 | * |
| 109 | 108 | * @param mixed $cb Callable function/method. |
| 110 | - * @return mixed Results of output buffer after calling function/method. |
|
| 109 | + * @return string Results of output buffer after calling function/method. |
|
| 111 | 110 | */ |
| 112 | 111 | public function get_cb_results( $cb ) { |
| 113 | 112 | $args = func_get_args(); |
@@ -142,6 +141,9 @@ discard block |
||
| 142 | 141 | return apply_filters( 'cmb2_rest_prepare', rest_ensure_response( $data ), $this->request, $this ); |
| 143 | 142 | } |
| 144 | 143 | |
| 144 | + /** |
|
| 145 | + * @param string $request_type |
|
| 146 | + */ |
|
| 145 | 147 | protected function initiate_rest_read_box( $request, $request_type ) { |
| 146 | 148 | $this->initiate_rest_box( $request, $request_type ); |
| 147 | 149 | |
@@ -1,19 +1,19 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Creates CMB2 objects/fields endpoint for WordPres REST API. |
|
| 4 | - * Allows access to fields registered to a specific post type and more. |
|
| 5 | - * |
|
| 6 | - * @todo Add better documentation. |
|
| 7 | - * @todo Research proper schema. |
|
| 8 | - * |
|
| 9 | - * @since 2.2.0 |
|
| 10 | - * |
|
| 11 | - * @category WordPress_Plugin |
|
| 12 | - * @package CMB2 |
|
| 13 | - * @author WebDevStudios |
|
| 14 | - * @license GPL-2.0+ |
|
| 15 | - * @link http://webdevstudios.com |
|
| 16 | - */ |
|
| 3 | + * Creates CMB2 objects/fields endpoint for WordPres REST API. |
|
| 4 | + * Allows access to fields registered to a specific post type and more. |
|
| 5 | + * |
|
| 6 | + * @todo Add better documentation. |
|
| 7 | + * @todo Research proper schema. |
|
| 8 | + * |
|
| 9 | + * @since 2.2.0 |
|
| 10 | + * |
|
| 11 | + * @category WordPress_Plugin |
|
| 12 | + * @package CMB2 |
|
| 13 | + * @author WebDevStudios |
|
| 14 | + * @license GPL-2.0+ |
|
| 15 | + * @link http://webdevstudios.com |
|
| 16 | + */ |
|
| 17 | 17 | abstract class CMB2_REST_Controller extends WP_REST_Controller { |
| 18 | 18 | |
| 19 | 19 | /** |
@@ -100,7 +100,6 @@ |
||
| 100 | 100 | * |
| 101 | 101 | * @since 2.2.0 |
| 102 | 102 | * |
| 103 | - * @param CMB2 $cmb |
|
| 104 | 103 | * @return array |
| 105 | 104 | */ |
| 106 | 105 | public function get_rest_box() { |