prefix . "terms"; $table_tax = $wpdb->prefix . "term_taxonomy"; $exists = $wpdb->get_results( "SELECT * FROM $table_tax WHERE taxonomy = 'advert_types'", OBJECT ); if (empty($exists)) { $sql = "INSERT INTO $table_terms (`name`, `slug`, `term_group`) VALUES ('Sidebar', 'sidebar', '0')"; dbDelta($sql); $term_id = $wpdb->insert_id; $sql = "INSERT INTO $table_tax (`term_id`, `taxonomy`, `description`, `parent`, `count`) VALUES ('".$term_id."', 'advert_types', '', '0', '0')"; dbDelta($sql); } // Register AKP capabilities to all users $role = get_role( 'subscriber' ); $role->add_cap( 'akp_edit_one' ); $role = get_role( 'contributor' ); $role->add_cap( 'akp_edit_one' ); $role->add_cap( 'akp_edit_two' ); $role = get_role( 'author' ); $role->add_cap( 'akp_edit_one' ); $role->add_cap( 'akp_edit_two' ); $role->add_cap( 'akp_edit_three' ); $role = get_role( 'editor' ); $role->add_cap( 'akp_edit_one' ); $role->add_cap( 'akp_edit_two' ); $role->add_cap( 'akp_edit_three' ); $role->add_cap( 'akp_edit_four' ); $role = get_role( 'administrator' ); $role->add_cap( 'akp_edit_one' ); $role->add_cap( 'akp_edit_two' ); $role->add_cap( 'akp_edit_three' ); $role->add_cap( 'akp_edit_four' ); $role->add_cap( 'akp_edit_five' ); $user = new WP_User(); $user->get_role_caps(); } function deactivate() { if ( ! current_user_can( 'activate_plugins' ) ) return; $plugin = isset( $_REQUEST['plugin'] ) ? $_REQUEST['plugin'] : ''; check_admin_referer( "deactivate-plugin_{$plugin}" ); } function languages_init() { load_plugin_textdomain('akptext', false, basename( dirname( __FILE__ ) ) . '/languages' ); } function settings_link($action_links,$plugin_file){ if($plugin_file==plugin_basename(__FILE__)){ $akp_settings_link = '' . __("Settings", 'akptext') . ''; array_unshift($action_links,$akp_settings_link); } return $action_links; } } } new AdKingPro(); require_once plugin_dir_path(__FILE__).'includes/widget.php'; require_once plugin_dir_path(__FILE__).'includes/admin_area.php'; require_once plugin_dir_path(__FILE__).'includes/output.php'; require_once plugin_dir_path(__FILE__).'js/adkingpro-js.php';