/var/www/hkosl.com/aga/wp-content/plugins/smart-slider-3/includes/integrations/tablepress.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php

class SmartSliderTablePressFix {

    private 
$level 0;

    public function 
__construct() {
        
add_filter('pre_do_shortcode_tag', array(
            
$this,
            
'before'
        
), 102);
        
add_filter('do_shortcode_tag', array(
            
$this,
            
'after'
        
), 102);

    }

    public function 
before($ret$tag) {

        if (
$tag == 'table') {
            
$this->level++;
            if (
$this->level == 1) {
                
N2SS3Shortcode::shortcodeModeToSkip();
            }
        }

        return 
$ret;
    }

    public function 
after($output$tag) {

        if (
$tag == 'table') {
            
$this->level--;
            if (
$this->level <= 0) {
                
N2SS3Shortcode::shortcodeModeRestore();

                global 
$shortcode_tags;
                
$tmp            $shortcode_tags;
                
$shortcode_tags = array(
                    
'smartslider3' => 'N2SS3Shortcode::doShortcode'
                
);

                
$output do_shortcode($output);

                
$shortcode_tags $tmp;
            }
        }

        return 
$output;
    }
}

new 
SmartSliderTablePressFix();