Jetpack_JSON_API_Plugins_Endpoint::validate_plugin PHP Méthode

validate_plugin() protected méthode

protected validate_plugin ( $plugin )
    protected function validate_plugin($plugin)
    {
        if (!isset($plugin) || empty($plugin)) {
            return new WP_Error('missing_plugin', __('You are required to specify a plugin to activate.', 'jetpack'), 400);
        }
        if (is_wp_error($error = validate_plugin($plugin))) {
            return new WP_Error('unknown_plugin', $error->get_error_messages(), 404);
        }
        return true;
    }