Skip to content

Instantly share code, notes, and snippets.

@code-flow
Created October 10, 2018 04:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save code-flow/70bc1adc1a4c4ac155c5d620a541bac3 to your computer and use it in GitHub Desktop.
Save code-flow/70bc1adc1a4c4ac155c5d620a541bac3 to your computer and use it in GitHub Desktop.
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
Copy link
Author

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