PluginProbe
Team Members Showcase / trunk
Team Members Showcase vtrunk
4.1.3 4.1.2 4.1.1 4.1.0 4.0.1 4.0.0 trunk 2.9.0 2.9.1 2.9.2 2.9.3 2.9.4 2.9.5 2.9.6 2.9.8 2.9.9 3.0.0 3.1.0 3.1.1 3.1.5 3.2.3 3.3.0 3.3.1 3.3.2 3.3.4 All 41 releases
wps-team / includes / compatibility.php

compatibility.php in Team Members Showcase trunk, at includes/compatibility.php

42 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace WPSpeedo_Team;
4
5 if ( ! defined('ABSPATH') ) exit;
6
7 class Compatibility {
8
9 // Constructor
10 public function __construct() {
11
12 if ( $this->is_theme('OceanWP') ) {
13 if ( get_theme_mod( 'ocean_performance_scroll_effect', 'enabled' ) === 'enabled' ) {
14 // Disable OceanWP scroll effect on team member links
15 add_filter( 'wpspeedo_team/post_link_attrs', [ $this, 'modify_oceanwp_link_attrs' ], 10, 2 );
16 }
17 }
18
19 }
20
21 // Modify link attributes for OceanWP theme
22 public function modify_oceanwp_link_attrs( $attrs, $action ) {
23 if ( in_array( $action, ['modal', 'expand', 'side-panel'] ) ) {
24 if ( ! isset( $attrs['class'] ) ) $attrs['class'] = 'opl-link';
25 else $attrs['class'] .= ' opl-link';
26 }
27 return $attrs;
28 }
29
30 // Check if the $theme is in theme or parent theme
31 public function is_theme( $theme ) {
32 $current_theme = wp_get_theme();
33 if ( $current_theme->get('Name') === $theme ) {
34 return true;
35 }
36 if ( $current_theme->parent() && $current_theme->parent()->get('Name') === $theme ) {
37 return true;
38 }
39 return false;
40 }
41
42 }