Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter cryptot

    (@cryptot)

    ?? will do

    Thread Starter cryptot

    (@cryptot)

    Is Resolved..I made an error in my code when copying from old snippet and changing things. Thank you for reading. Great Plugin.

    P.S.
    For others interested.
    Set-Up Being Used to have a NEW account Tab created and with WP 2FA shortcode for User to manage themselves.

    1. Add This Code with “Code Snippets” Plugin – Replace garage match with your information required.

    // ------------------
    <strong>// 1. Register new endpoint to use for My Account page
    // Note: Resave Permalinks or it will give 404 error</strong>
      
    function bbloomer_add_Garage_Match_endpoint() {
        add_rewrite_endpoint( 'garage-match', EP_ROOT | EP_PAGES );
    }
      
    add_action( 'init', 'bbloomer_add_garage_match_endpoint' );
      
      
    // ------------------
    // 2. Add new query var
      
    function bbloomer_garage_match_query_vars( $vars ) {
        $vars[] = 'garage-match';
        return $vars;
    }
      
    add_filter( 'query_vars', 'bbloomer_garage_match_query_vars', 0 );
      
      
    // ------------------
    // 3. Insert the new endpoint into the My Account menu
      
    function bbloomer_add_garage_match_link_my_account( $items ) {
        $items['garage-match'] = 'GarageMatch';
        return $items;
    }
      
    add_filter( 'woocommerce_account_menu_items', 'bbloomer_add_garage_match_link_my_account' );
      
      
    // ------------------
    // 4. Add content to the new endpoint
      
    function bbloomer_garage_match_content() {
    echo '<h3>Auto Repair Marketplace</h3><p>Find quality auto repair shops near you
    Get multiple quotes, choose a shop, pick a date, pay online. <i>Please contact support if you have any questions concerning your auto maintenance.</i> 
    <a href=\\get-great-quotes-from-quality-repair-shops/\\">  Learn More</a>  </p>';
    echo do_shortcode( '<strong>[wp-2fa-setup-form]</strong>' );
    }
      
    add_action( 'woocommerce_account_garage-match_endpoint', 'bbloomer_garage_match_content' );
    // Note: add_action must follow 'woocommerce_account_{garage-match}_endpoint' format

    2. Activate the code – don’t forget to replace garage match with YOUR respective information + Re-Save permalinks under settings.

    3.

    Can users access the WordPress dashboard or you have custom profile pages?
    If your users do not have access to the WordPress dashboard (because you use custom user profile pages) enable this option. Once enabled, the plugin creates a page which ONLY authenticated users can access to configure their user 2FA settings. A link to this page is sent in the 2FA welcome email.

    Frontend 2FA settings page Yes No

    ***select NO — the shortcode will still show on the new end point you just created in my account menu.

    Code from – BBloomer site – Rudolfo

    Hope this helps someone. Thx

Viewing 2 replies - 1 through 2 (of 2 total)