Няма описание

compat.php 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. class NextendSocialLoginCompatibility {
  3. public function __construct() {
  4. add_action('after_setup_theme', array(
  5. $this,
  6. 'after_setup_theme'
  7. ), 11);
  8. add_action('wp_head', array(
  9. $this,
  10. 'wplms_hide_duplicate_buttons'
  11. ), 10);
  12. }
  13. public function after_setup_theme() {
  14. global $pagenow;
  15. /** Compatibility fix for Socialize theme @SEE https://themeforest.net/item/socialize-multipurpose-buddypress-theme/12897637 */
  16. if (function_exists('ghostpool_login_redirect')) {
  17. if ('wp-login.php' === $pagenow && !empty($_GET['loginSocial'])) {
  18. /** If the action not removed, then the wp-login.php always redirected to {siteurl}/#login/ and it break social login */
  19. remove_action('init', 'ghostpool_login_redirect');
  20. }
  21. }
  22. }
  23. public function wplms_hide_duplicate_buttons() {
  24. if (class_exists('vibe_bp_login', false)) {
  25. echo "<style>
  26. /**
  27. WPLMS triggers the same hook twice in the same form -> Hide duplicated social buttons.
  28. */
  29. div#vibe_bp_login div#nsl-custom-login-form-2{
  30. display:none;
  31. }
  32. </style>
  33. ";
  34. }
  35. }
  36. }
  37. new NextendSocialLoginCompatibility();