Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Changes the standard capabilities to access SNIPs REST API to a different value.
<?php
/*
Plugin Name: snip - REST API Capability Changer
Plugin URI: https://rich-snippets.io/global-snippets-capabilities/
Description: Changes the standard capabilities to access SNIPs REST API to a different value.
Version: 0.1.0
Author: floriansimeth
Author URI: https://florian-simeth.de
License: License: GPLv2 or later
Copyright (c) 2018 Florian Simeth
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
add_filter( 'wpbuddy/rich_snippets/rest/permission', function () {
return current_user_can( 'manage_options' );
} );
@code-flow

This comment has been minimized.

Copy link
Owner Author

code-flow commented Oct 10, 2018

Change line number 32 so that it fits your needs.

Please follow the instructions found here on how to control access to SNIPs REST API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.