register_hook_callback(); } /** * callbacks for commenting hooks */ public function register_hook_callback() { global $loginRadiusSettings, $user_ID; // show social login interface on comment form if ( isset( $loginRadiusSettings['LoginRadius_commentEnable'] ) && $loginRadiusSettings['LoginRadius_commentEnable'] == '1' ) { if ( get_option( 'comment_registration' ) && intval( $user_ID ) == 0 && $loginRadiusSettings['LoginRadius_commentform'] != '' ) { add_action( 'comment_form_must_log_in_after', array('Login_Helper', 'display_social_login_interface') ); } elseif ( isset( $loginRadiusSettings['LoginRadius_commentInterfacePosition'] ) ) { switch ( $loginRadiusSettings['LoginRadius_commentInterfacePosition'] ) { case 'very_top': $commentHook = 'comment_form_before'; break; case 'before_fields': $commentHook = 'comment_form_before_fields'; break; case 'after_fields': $commentHook = 'comment_form_after_fields'; break; case 'very_bottom': $commentHook = 'comment_form_after'; break; case 'after_leave_reply': $commentHook = 'comment_form_top'; break; default: $commentHook = 'after_leave_reply'; } add_action( $commentHook, array('Login_Helper', 'display_social_login_interface') ); } } } } }