nextend-facebook-connect
Last commit date
NSL
3 years ago
admin
3 years ago
includes
3 years ago
js
3 years ago
languages
3 years ago
providers
3 years ago
template-parts
3 years ago
class-settings.php
6 years ago
compat.php
6 years ago
index.html
13 years ago
licence.txt
6 years ago
nextend-facebook-connect.php
3 years ago
nextend-social-login.php
3 years ago
readme.txt
3 years ago
widget.php
6 years ago
compat.php
47 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | class NextendSocialLoginCompatibility { |
| 5 | |
| 6 | public function __construct() { |
| 7 | add_action('after_setup_theme', array( |
| 8 | $this, |
| 9 | 'after_setup_theme' |
| 10 | ), 11); |
| 11 | |
| 12 | add_action('wp_head', array( |
| 13 | $this, |
| 14 | 'wplms_hide_duplicate_buttons' |
| 15 | ), 10); |
| 16 | |
| 17 | } |
| 18 | |
| 19 | public function after_setup_theme() { |
| 20 | global $pagenow; |
| 21 | |
| 22 | /** Compatibility fix for Socialize theme @SEE https://themeforest.net/item/socialize-multipurpose-buddypress-theme/12897637 */ |
| 23 | if (function_exists('ghostpool_login_redirect')) { |
| 24 | if ('wp-login.php' === $pagenow && !empty($_GET['loginSocial'])) { |
| 25 | /** If the action not removed, then the wp-login.php always redirected to {siteurl}/#login/ and it break social login */ |
| 26 | remove_action('init', 'ghostpool_login_redirect'); |
| 27 | } |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | public function wplms_hide_duplicate_buttons() { |
| 32 | if (class_exists('vibe_bp_login', false)) { |
| 33 | echo "<style> |
| 34 | /** |
| 35 | WPLMS triggers the same hook twice in the same form -> Hide duplicated social buttons. |
| 36 | */ |
| 37 | div#vibe_bp_login div#nsl-custom-login-form-2{ |
| 38 | display:none; |
| 39 | } |
| 40 | </style> |
| 41 | "; |
| 42 | } |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | new NextendSocialLoginCompatibility(); |
| 47 |