|
@@ 2399-2401 (lines=3) @@
|
| 2396 |
|
* @return bool|WP_Error |
| 2397 |
|
*/ |
| 2398 |
|
public static function validate_module_list( $value = '', $request, $param ) { |
| 2399 |
|
if ( ! is_array( $value ) ) { |
| 2400 |
|
return new WP_Error( 'invalid_param_value', sprintf( esc_html__( '%s must be an array', 'jetpack' ), $param ) ); |
| 2401 |
|
} |
| 2402 |
|
|
| 2403 |
|
$modules = Jetpack::get_available_modules(); |
| 2404 |
|
|
|
@@ 2482-2484 (lines=3) @@
|
| 2479 |
|
*/ |
| 2480 |
|
public static function validate_sharing_show( $value, $request, $param ) { |
| 2481 |
|
$views = array( 'index', 'post', 'page', 'attachment', 'jetpack-portfolio' ); |
| 2482 |
|
if ( ! is_array( $value ) ) { |
| 2483 |
|
return new WP_Error( 'invalid_param', sprintf( esc_html__( '%s must be an array of post types.', 'jetpack' ), $param ) ); |
| 2484 |
|
} |
| 2485 |
|
if ( ! array_intersect( $views, $value ) ) { |
| 2486 |
|
return new WP_Error( 'invalid_param', sprintf( |
| 2487 |
|
/* 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 */ |