|
@@ 2459-2461 (lines=3) @@
|
| 2456 |
|
* @return bool|WP_Error |
| 2457 |
|
*/ |
| 2458 |
|
public static function validate_module_list( $value = '', $request, $param ) { |
| 2459 |
|
if ( ! is_array( $value ) ) { |
| 2460 |
|
return new WP_Error( 'invalid_param_value', sprintf( esc_html__( '%s must be an array', 'jetpack' ), $param ) ); |
| 2461 |
|
} |
| 2462 |
|
|
| 2463 |
|
$modules = Jetpack::get_available_modules(); |
| 2464 |
|
|
|
@@ 2542-2544 (lines=3) @@
|
| 2539 |
|
*/ |
| 2540 |
|
public static function validate_sharing_show( $value, $request, $param ) { |
| 2541 |
|
$views = array( 'index', 'post', 'page', 'attachment', 'jetpack-portfolio' ); |
| 2542 |
|
if ( ! is_array( $value ) ) { |
| 2543 |
|
return new WP_Error( 'invalid_param', sprintf( esc_html__( '%s must be an array of post types.', 'jetpack' ), $param ) ); |
| 2544 |
|
} |
| 2545 |
|
if ( ! array_intersect( $views, $value ) ) { |
| 2546 |
|
return new WP_Error( 'invalid_param', sprintf( |
| 2547 |
|
/* Translators: first variable is the name of a parameter passed to endpoint holding the post type where Sharing will be displayed, the second is a list of post types where Sharing can be displayed */ |