Support » Plugin: Two Factor Authentication » Adding to Buddy Press profile and Woocommerce account settings.

  • Awesome plugin, to add it to the front end for Buddy Press and/or Woocommerce.

    To add to Buddy Press member profile settings.

    add_action('bp_after_member_settings_template', 'custom_member_settings_template');
    function custom_member_settings_template() {
       echo '<br><h2 class="screen-heading general-settings-screen">Two Factor Authentication</h2>';
       echo '[twofactor_user_settings]';
    }

    To add to Woocommerce edit account form.

    add_action('woocommerce_after_edit_account_form', 'custom_wc_after_edit_account_form');
    function custom_wc_after_edit_account_form() {
       echo '<br><h2 class="screen-heading general-settings-screen">Two Factor Authentication</h2>';
    
       echo do_shortcode('[twofactor_user_settings]');
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • That is exactly what I have been looking for. I’ve added the TFA plugin Two Factor Authentication (https://wordpress.org/plugins/two-factor-authentication/#installation), and I’ve enabled it for all users (Admin, subscriber etc). It works for my account when I access the login page. But I can’t work out how to add the settings for the users themselves during their registration because the registration page is a BuddyPress one with extended profiles etc.

    The plugin says to add the [twofactor_user_settings] shortcode to ‘a page’, but the page I need to add it to is the BuddyPress registration page, and their user profiles are all controlled by BuddyPress. So if I add that shortcode, it does not show.

    Do you know where to put the BP member profile code you pasted above? What file does it go in? Thanks

    • This reply was modified 3 years, 3 months ago by ted_smith.
    • This reply was modified 3 years, 3 months ago by ted_smith.
    Thread Starter liammitchell

    (@liammitchell)

    Hi @ted_smith,

    If I remember right I put it in my sites plugin functions.php
    But could probably go in wordpress theme functions.php as well.

    I like to make a plugin for site specific codes rather than to mess with the theme (which could change).

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Adding to Buddy Press profile and Woocommerce account settings.’ is closed to new replies.