Inventory_Presser_Plugin::add_admin_capabilities()
Administrators should always have full control over posts in our custom post type. No other users will have any capabilities.
Return Return
(void)
Source Source
File: inventory-presser.php
public function add_admin_capabilities() { $role = get_role( 'administrator' ); if ( ! $role ) { return; } $role->add_cap( 'delete_' . INVP::POST_TYPE . 's' ); $role->add_cap( 'delete_others_' . INVP::POST_TYPE . 's' ); $role->add_cap( 'delete_private_' . INVP::POST_TYPE . 's' ); $role->add_cap( 'delete_published_' . INVP::POST_TYPE . 's' ); $role->add_cap( 'edit_' . INVP::POST_TYPE . 's' ); $role->add_cap( 'edit_others_' . INVP::POST_TYPE . 's' ); $role->add_cap( 'edit_private_' . INVP::POST_TYPE . 's' ); $role->add_cap( 'edit_published_' . INVP::POST_TYPE . 's' ); $role->add_cap( 'publish_' . INVP::POST_TYPE . 's' ); $role->add_cap( 'read_private_' . INVP::POST_TYPE . 's' ); }
Expand full source codeCollapse full source codeView on Github