|
@@ 1726-1728 (lines=3) @@
|
| 1723 |
|
* @return bool |
| 1724 |
|
*/ |
| 1725 |
|
public static function validate_module_list( $value = '', $request, $param ) { |
| 1726 |
|
if ( ! is_array( $value ) ) { |
| 1727 |
|
return new WP_Error( 'invalid_param_value', sprintf( esc_html__( '%s must be an array', 'jetpack' ), $param ) ); |
| 1728 |
|
} |
| 1729 |
|
|
| 1730 |
|
$modules = Jetpack::get_available_modules(); |
| 1731 |
|
|
|
@@ 1809-1811 (lines=3) @@
|
| 1806 |
|
*/ |
| 1807 |
|
public static function validate_sharing_show( $value, $request, $param ) { |
| 1808 |
|
$views = array( 'index', 'post', 'page', 'attachment', 'jetpack-portfolio' ); |
| 1809 |
|
if ( ! is_array( $value ) ) { |
| 1810 |
|
return new WP_Error( 'invalid_param', sprintf( esc_html__( '%s must be an array of post types.', 'jetpack' ), $param ) ); |
| 1811 |
|
} |
| 1812 |
|
if ( ! array_intersect( $views, $value ) ) { |
| 1813 |
|
return new WP_Error( 'invalid_param', sprintf( |
| 1814 |
|
/* 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 */ |