Skip to content

Instantly share code, notes, and snippets.

@aaronjorbin
Created March 6, 2014 21:10
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 aaronjorbin/9399693 to your computer and use it in GitHub Desktop.
Save aaronjorbin/9399693 to your computer and use it in GitHub Desktop.
<?php
/*
Plugin name: Super LaFours
Description: Removes caps for actions that should take place in code, not in UI
Author: Aaron Jorbin
Author URI: http://aaron.jorb.in/
Version: 0.1
*/
function super_lafours_map_meta_cap($caps, $cap, $user_id, $args) {
if ($cap !== 'read'){
$caps = array();
$caps[] = 'do_not_allow';
}
return $caps;
}
add_filter('map_meta_cap', 'super_lafours_map_meta_cap', 10, 4);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment