コード例 #1
0
function mlm_remove()
{
    mlm_core_drop_tables();
    //delete the data from wp_options table
    delete_option('wp_mlm_general_settings');
    delete_option('wp_mlm_eligibility_settings');
    delete_option('wp_mlm_payout_settings');
    delete_option('wp_mlm_bonus_settings');
    delete_option('menu_check');
    delete_option('update_user_role_check');
    $theme_slug = get_option('stylesheet');
    delete_option("theme_mods_{$theme_slug}");
    //delete the menu name form wp_terms table
}
コード例 #2
0
function mlm_remove()
{
    mlm_core_drop_tables();
    //$mlmPages contain the meta_key of the created mlm plugin pages
    $mlmPages = array('mlm_registration_page', 'mlm_network_page', 'mlm_network_genealogy_page', 'mlm_network_details_page', 'mlm_my_payout_page', 'mlm_my_payout_details_page', 'mlm_update_profile_page', 'mlm_change_password_page', 'mlm_distribute_bonus', 'mlm_distribute_commission', 'mlm_personal_group_details_page', 'mlm_payment_status_details_page', 'mlm-payment-process', 'mlm_my_financial_dashboard_page', 'mlm_my_child_member_details_page', 'mlm_epin_update_page');
    //delete post from wp_posts and wp_postmeta table
    foreach ($mlmPages as $value) {
        $post_id = get_post_id($value);
        wp_delete_post($post_id, true);
    }
    //delete the data from wp_options table
    delete_option('wp_mlm_general_settings');
    delete_option('wp_mlm_eligibility_settings');
    delete_option('wp_mlm_payout_settings');
    delete_option('wp_mlm_regular_bonus_settings');
    delete_option('wp_mlm_royalty_bonus_settings');
    delete_option('wp_mlm_other_method_settings');
    delete_option('wp_mlm_withdrawal_method_settings');
    delete_option('wp_mlm_payment_settings');
    delete_option('wp_mlm_epin_settings');
    delete_option('menu_check');
    $theme_slug = get_option('stylesheet');
    delete_option("theme_mods_{$theme_slug}");
    //delete the menu name form wp_terms table
    $term = get_term_by('name', MENU_NAME, 'nav_menu');
    wp_delete_term($term->term_id, 'nav_menu');
}