← All changes
|
libraries/cmb2/includes/rest-api/CMB2_REST_Controller_Fields.php
+4
-2
6.0.0
→
6.0.3
View file →
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * CMB2 objects/fields endpoint for WordPres REST API. | |
| 3 | + * CMB2 objects/fields endpoint for WordPress REST API. | |
| 4 | 4 | * Allows access to fields registered to a specific box. |
| 5 | 5 | * |
| 6 | 6 | * @todo Add better documentation. |
| 7 | 7 | * @todo Research proper schema. |
| @@ -380,9 +380,10 @@ | ||
| 380 | 380 | 'options_cb' => 'options', |
| 381 | 381 | ); |
| 382 | 382 | |
| 383 | 383 | // Run this first so the js_dependencies arg is populated. |
| 384 | - $rendered = ( $cb = $field->maybe_callback( 'render_row_cb' ) ) | |
| 384 | + $cb = $field->maybe_callback( 'render_row_cb' ); | |
| 385 | + $rendered = $cb | |
| 385 | 386 | // Ok, callback is good, let's run it. |
| 386 | 387 | ? $this->get_cb_results( $cb, $field->args(), $field ) |
| 387 | 388 | : false; |
| 388 | 389 | |
| @@ -411,8 +412,9 @@ | ||
| 411 | 412 | |
| 412 | 413 | if ( empty( $value ) || is_scalar( $value ) || is_array( $value ) ) { |
| 413 | 414 | $field_data[ $key ] = $value; |
| 414 | 415 | } else { |
| 416 | + // translators: %s: field key. | |
| 415 | 417 | $field_data[ $key ] = sprintf( __( 'Value Error for %s', 'cmb2' ), $key ); |
| 416 | 418 | } |
| 417 | 419 | } |
| 418 | 420 | |