Title: [Plugin: Theme My Login] TML &amp; Simple FB Connect plugins issues
Last modified: August 19, 2016

---

# [Plugin: Theme My Login] TML & Simple FB Connect plugins issues

 *  Resolved [andybala](https://wordpress.org/support/users/andybala/)
 * (@andybala)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/plugin-theme-my-login-tml-simple-fb-connect-plugins-issues/)
 * Hi,
 * I’m using WP 3.0.1 with TML 6.0.1 Alpha along with Simple Facebook Connect Ver
   0.21. I found two issues.
 * 1. For some reason, the Connect Using Facebook does not appear by default on 
   the login page when TML is enabled, but appears in the default WP login screen,
   when TML is diabled. (The workaround that I did on the template file was adding`
   if($_GET['action']=='login' || !isset($_GET['action'])) echo sfc_connect_shortcode();`
   just after calling the_content() )
 * 2. After logging into the system using FB credentials, in the profile page when
   TML is enabled, although I’m getting the button “Attach this FB account to WP
   account” (or something similar), the button seems to throw an error upon clicking
   stating “Button not defined”. But the same functionality works fine if TML is
   not enabled. (I haven’t worked on this issue yet)
 * I tried looking at the forums of SFC for a solution, but the Author had mentioned
   in one of his replies to contact the Author of TML just to check if all the hooks
   have been included.
 * I would like to know if anyone else is facing this problem and if they found 
   the solution. Appreciate your help.
 * Best.

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

 *  Plugin Author [Jeff Farthing](https://wordpress.org/support/users/jfarthing84/)
 * (@jfarthing84)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/plugin-theme-my-login-tml-simple-fb-connect-plugins-issues/#post-1706516)
 * TML calls all of the same hooks as _wp-login.php_…
 *  Thread Starter [andybala](https://wordpress.org/support/users/andybala/)
 * (@andybala)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/plugin-theme-my-login-tml-simple-fb-connect-plugins-issues/#post-1706519)
 * Hello Jeff,
 * Thank you very much for responding. Do you think you could give me your email
   ID and I could send you a screenshot of the issues or could provide you with 
   the source files if you require them and could also send you the link to the 
   site? Thanks again.
 * Best.
 *  Plugin Author [Jeff Farthing](https://wordpress.org/support/users/jfarthing84/)
 * (@jfarthing84)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/plugin-theme-my-login-tml-simple-fb-connect-plugins-issues/#post-1706524)
 * jeff [at] jfarthing [dot] com.
 *  Plugin Author [Jeff Farthing](https://wordpress.org/support/users/jfarthing84/)
 * (@jfarthing84)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/plugin-theme-my-login-tml-simple-fb-connect-plugins-issues/#post-1706572)
 * The problem is that SFC expects _$action_ to be defined as a global variable,
   as it is defined at a global scope in _wp-login.php_. TML defines it within a
   function, therefore it is not global by default.
 * So, create a file called _theme-my-login-custom.php_ in the _plugins_ directory.
   This is a file that TML always includes upon initialization, intended to maintain
   customizations between upgrades. Create a callback for a hook I provided in TML,
   called _tml\_request_. The callback will simply assign the proper action to the
   global $action variable.
 *     ```
       function tml_request( &$theme_my_login ) {
       	$GLOBALS['action'] = $theme_my_login->request_action;
       }
       add_action( 'tml_request', 'tml_request' );
       ```
   
 *  Plugin Author [Jeff Farthing](https://wordpress.org/support/users/jfarthing84/)
 * (@jfarthing84)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/plugin-theme-my-login-tml-simple-fb-connect-plugins-issues/#post-1706591)
 * As for issue #2, this is caused by the proper javascript needed by SFC not being
   called, as it is attached to the _admin\_footer_ hook, which is only called in
   the admin area. Of course, the default profile is in the admin area, but TML 
   is not. So, we just need to hook the required action to _wp\_footer_ instead.
 * So, change the above code to this:
 *     ```
       function tml_request( &$theme_my_login ) {
       	$GLOBALS['action'] = $theme_my_login->request_action;
   
       	if ( 'profile' == $theme_my_login->request_action )
       		add_action( 'wp_footer', 'sfc_login_update_js', 30) ;
       }
       add_action( 'tml_request', 'tml_request' );
       ```
   
 *  [phoenixdzine](https://wordpress.org/support/users/phoenixdzine/)
 * (@phoenixdzine)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-theme-my-login-tml-simple-fb-connect-plugins-issues/#post-1706852)
 * Create a file called theme-my-login-custom.php in the plugins directory.
 * Does it have to contain anything ?
    Where does this go ?
 *     ```
       function tml_request( &$theme_my_login ) {
       	$GLOBALS['action'] = $theme_my_login->request_action;
   
       	if ( 'profile' == $theme_my_login->request_action )
       		add_action( 'wp_footer', 'sfc_login_update_js', 30) ;
       }
       add_action( 'tml_request', 'tml_request' );
       ```
   
 * What if I have two Footers
 *  Plugin Author [Jeff Farthing](https://wordpress.org/support/users/jfarthing84/)
 * (@jfarthing84)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-theme-my-login-tml-simple-fb-connect-plugins-issues/#post-1706853)
 * `theme-my-login-custom.php`
 *  [phoenixdzine](https://wordpress.org/support/users/phoenixdzine/)
 * (@phoenixdzine)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-theme-my-login-tml-simple-fb-connect-plugins-issues/#post-1706854)
 * When you say plugins directory for you mean the root or TML directory. I had 
   it in the TML directory and still cannot see the button for SFC
 *  [phoenixdzine](https://wordpress.org/support/users/phoenixdzine/)
 * (@phoenixdzine)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-theme-my-login-tml-simple-fb-connect-plugins-issues/#post-1706855)
 * Put it in the plugins directory (root) and it works on all footers.
    Seemed to
   easy I suppose.
 * Thanx

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

The topic ‘[Plugin: Theme My Login] TML & Simple FB Connect plugins issues’ is closed
to new replies.

 * ![](https://ps.w.org/theme-my-login/assets/icon-256x256.png?rev=1891232)
 * [Theme My Login](https://wordpress.org/plugins/theme-my-login/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/theme-my-login/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/theme-my-login/)
 * [Active Topics](https://wordpress.org/support/plugin/theme-my-login/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/theme-my-login/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/theme-my-login/reviews/)

 * 9 replies
 * 3 participants
 * Last reply from: [phoenixdzine](https://wordpress.org/support/users/phoenixdzine/)
 * Last activity: [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-theme-my-login-tml-simple-fb-connect-plugins-issues/#post-1706855)
 * Status: resolved