Skip to content

Instantly share code, notes, and snippets.

@code-flow
Created April 13, 2020 09:28
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/9390806edb2e4e0c01934bc0c62be3e5 to your computer and use it in GitHub Desktop.
Save code-flow/9390806edb2e4e0c01934bc0c62be3e5 to your computer and use it in GitHub Desktop.
Permissions for editors in SNIP
<?php
/*
Plugin Name: snip Permissions
Description: Sets permissions to use SNIPs REST API the way you like it.
Version: 0.1.0
*/
add_filter(
'wpbuddy/rich_snippets/rest/permission',
function () {
# change this to any capability you want: https://wordpress.org/support/article/roles-and-capabilities/
return current_user_can('edit_posts');
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment