forked from justintadlock/custom-content-portfolio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
uninstall.php
34 lines (26 loc) · 1.05 KB
/
uninstall.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
/**
* Uninstall procedure for the plugin.
*
* @package CustomContentPortfolio
* @since 0.1.0
* @author Justin Tadlock <[email protected]>
* @copyright Copyright (c) 2013, Justin Tadlock
* @link http://themehybrid.com/plugins/custom-content-portfolio
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/
/* Make sure we're actually uninstalling the plugin. */
if ( !defined( 'WP_UNINSTALL_PLUGIN' ) )
wp_die( sprintf( __( '%s should only be called when uninstalling the plugin.', 'custom-content-portfolio' ), '<code>' . __FILE__ . '</code>' ) );
/* === Delete plugin options. === */
delete_option( 'plugin_custom_content_portfolio' );
/* === Remove capabilities added by the plugin. === */
/* Get the administrator role. */
$role =& get_role( 'administrator' );
/* If the administrator role exists, remove added capabilities for the plugin. */
if ( !empty( $role ) ) {
$role->remove_cap( 'manage_portfolio' );
$role->remove_cap( 'create_portfolio_items' );
$role->remove_cap( 'edit_portfolio_items' );
}
?>