|
@@ 1903-1905 (lines=3) @@
|
| 1900 |
|
* @return bool |
| 1901 |
|
*/ |
| 1902 |
|
public static function validate_module_list( $value = '', $request, $param ) { |
| 1903 |
|
if ( ! is_array( $value ) ) { |
| 1904 |
|
return new WP_Error( 'invalid_param_value', sprintf( esc_html__( '%s must be an array', 'jetpack' ), $param ) ); |
| 1905 |
|
} |
| 1906 |
|
|
| 1907 |
|
$modules = Jetpack::get_available_modules(); |
| 1908 |
|
|
|
@@ 1986-1988 (lines=3) @@
|
| 1983 |
|
*/ |
| 1984 |
|
public static function validate_sharing_show( $value, $request, $param ) { |
| 1985 |
|
$views = array( 'index', 'post', 'page', 'attachment', 'jetpack-portfolio' ); |
| 1986 |
|
if ( ! is_array( $value ) ) { |
| 1987 |
|
return new WP_Error( 'invalid_param', sprintf( esc_html__( '%s must be an array of post types.', 'jetpack' ), $param ) ); |
| 1988 |
|
} |
| 1989 |
|
if ( ! array_intersect( $views, $value ) ) { |
| 1990 |
|
return new WP_Error( 'invalid_param', sprintf( |
| 1991 |
|
/* 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 */ |