Support » Plugin: Delete Me » Not displaying in the my account section

Viewing 1 replies (of 1 total)
  • Hello,

    this does not come automatically.
    i found this one at business bloomer. Add this to your functions.php (with your credentials) to create a new account tab.

    /**
    * @snippet WooCommerce Add New Tab @ My Account
    * @how-to Get CustomizeWoo.com FREE
    * @author Rodolfo Melogli
    * @compatible WooCommerce 3.5.7
    * @donate $9 https://businessbloomer.com/bloomer-armada/
    */

    // ——————
    // 1. Register new endpoint to use for My Account page
    // Note: Resave Permalinks or it will give 404 error

    function bbloomer_add_premium_support_endpoint() {
    add_rewrite_endpoint( ‘delete-account’, EP_ROOT | EP_PAGES );
    }

    add_action( ‘init’, ‘bbloomer_add_premium_support_endpoint’ );

    // ——————
    // 2. Add new query var

    function bbloomer_premium_support_query_vars( $vars ) {
    $vars[] = ‘delete-account’;
    return $vars;
    }

    add_filter( ‘query_vars’, ‘bbloomer_premium_support_query_vars’, 0 );

    // ——————
    // 3. Insert the new endpoint into the My Account menu

    function bbloomer_add_premium_support_link_my_account( $items ) {
    // Remove the logout menu item.
    $logout = $items[‘customer-logout’];
    unset( $items[‘customer-logout’] );

    // Insert your custom endpoint.
    $items[‘delete-account’] = ‘Delete Account’;

    // Insert back the logout item.
    $items[‘customer-logout’] = $logout;

    return $items;
    }

    add_filter( ‘woocommerce_account_menu_items’, ‘bbloomer_add_premium_support_link_my_account’ );

    // ——————
    // 4. Add content to the new endpoint

    function bbloomer_premium_support_content() {
    echo ‘<h3>Delete Account</h3>’;
    echo do_shortcode( ‘[plugin_delete_me /]’ );
    }

    add_action( ‘woocommerce_account_delete-account_endpoint’, ‘bbloomer_premium_support_content’ );
    // Note: add_action must follow ‘woocommerce_account_{your-endpoint-slug}_endpoint’ format

    // ——————
    // Redirect to Home from WC My Account Log Out

    add_action(‘wp_logout’,’auto_redirect_after_logout’);

    function auto_redirect_after_logout(){

    wp_redirect( home_url() );
    exit();

    }

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.