Title: Need function name for conditional loading
Last modified: August 31, 2016

---

# Need function name for conditional loading

 *  [Native Imaging](https://wordpress.org/support/users/native-imaging/)
 * (@native-imaging)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/need-function-name-for-conditional-loading/)
 * Love this plugin! Great work!
    I want to integrate the login form to my theme
   with php, but isn’t it always best to have a conditional if statement to skip
   loading if the plugins function isn’t active?
 *     ```
       <?php do_action( 'wordpress_social_login' ); ?>
       // Shouldn't it be?
       <?php if ( function_exists( 'wordpress_social_login') : do_action( 'wordpress_social_login' ); ?>
       ```
   
 * Excuse my PHP if not parsed correctly. Haven’t tested it yet.
 * Thanks!
    🙂
 * [https://wordpress.org/plugins/wordpress-social-login/](https://wordpress.org/plugins/wordpress-social-login/)

Viewing 1 replies (of 1 total)

 *  [VisualData](https://wordpress.org/support/users/visualdata/)
 * (@visualdata)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/need-function-name-for-conditional-loading/#post-7385816)
 * Hi,
 * If statement is not required in this case. the following statement only registers
   the action hook by the name “wordpress_social_login”. This hook may share the
   name with a function, but it is not a function.
 * do_action( ‘wordpress_social_login’ );
 * It simply does nothing before any function is added to this hook.
 * The function you add to the hook through add_action is referred to as “call back
   function”. WordPress will look for and execute your call back function at the
   above do_action statement.
 * if statement is required before adding a call back function. If the call back
   function does not exist, WordPress will throw an error.
 * I hope it helps.
 * Happy programming 🙂
 * Oliver

Viewing 1 replies (of 1 total)

The topic ‘Need function name for conditional loading’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wordpress-social-login_a1a2bc.svg)
 * [WordPress Social Login](https://wordpress.org/plugins/wordpress-social-login/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-social-login/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-social-login/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-social-login/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-social-login/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-social-login/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [VisualData](https://wordpress.org/support/users/visualdata/)
 * Last activity: [9 years, 10 months ago](https://wordpress.org/support/topic/need-function-name-for-conditional-loading/#post-7385816)
 * Status: not resolved