Created
February 5, 2015 16:03
-
-
Save mauriciogofas/aecfef00e8ac02bbe7a9 to your computer and use it in GitHub Desktop.
Custom Capability for especifc wp user
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Super User | |
function add_theme_caps() { | |
//to add capability to user | |
$user = new WP_User( $user_id = 1 ); //ID of user | |
$user->add_cap( 'custom_apability'); | |
} | |
add_action( 'admin_init', 'add_theme_caps'); | |
// |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment