C:\xampp\htdocs\landing\wp-content\updraft\plugins-old\penci-framework\mega-menu\menu-render.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<?php
/**
 * Content in mega menu
 *
 * @since 1.0
 * @return HTML inner mega menu
 */

function penci_return_html_mega_menu$row$width,$dis_ajax_filter$list_cats$sub_cat ) {

    if( isset( 
$list_cat['sub_cat'] ) ) {
        unset(
$list_cat['sub_cat']);
    }
    
/* Check rows to show number posts */
    
if ( ! isset ( $row ) || empty( $row ) ): $row '1'; endif;

    
$col             'col-mn-6 mega-row-1';
    
$numbers         6;
    
$count_list_cats count( (array)$list_cats );

    
$arr_has_mega    penci_mega_get_tax_support();

    if ( 
'fullwidth' == $width ) {
        
$col     'col-mn-8 mega-row-1';
        
$numbers 8;
    }

    if ( 
'width1080' == $width || 'width1170' == $width ) {
        
$col     'col-mn-5 mega-row-1';
        
$numbers 5;
    }

    if ( ! empty( 
$list_cats ) && == $sub_cat ) {

        if ( 
'fullwidth' == $width ) {
            
$col     'col-mn-7 mega-row-1';
            
$numbers 7;
        } elseif( 
'container' == $width ) {
            
$col     'col-mn-5 mega-row-1';
            
$numbers 5;
        }elseif ( 
'width1080' == $width || 'width1170' == $width ) {
            
$col     'col-mn-4 mega-row-1';
            
$numbers 4;
        }else {
            
$col     'col-mn-3 mega-row-1';
            
$numbers 3;
        }
    }

    if ( 
'2' == $row ) {
        
$col     'col-mn-6 mega-row-2';
        
$numbers 12;

        if ( 
'fullwidth' == $width ) {
            
$col     'col-mn-8 mega-row-2';
            
$numbers 16;
        }

        if ( 
'width1080' == $width || 'width1170' == $width ) {
            
$col     'col-mn-5 mega-row-2';
            
$numbers 10;
        }

        if ( ! empty( 
$list_cats ) && == $sub_cat ) {
            if ( 
'fullwidth' == $width ) {
                
$col     'col-mn-7 mega-row-2';
                
$numbers 14;
            } elseif( 
'container' == $width ) {
                
$col     'col-mn-5 mega-row-2';
                
$numbers 10;
            }elseif ( 
'width1080' == $width || 'width1170' == $width ) {
                
$col     'col-mn-4 mega-row-2';
                
$numbers 8;
            }else {
                
$col     'col-mn-3 mega-row-2';
                
$numbers 6;
            }
        }
    }
    
ob_start();
    
?>
    <?php if ( ! empty( $list_cats ) && == $sub_cat ): ?>
        <?php
        $class_child_cat 
$col;
        
$class_child_cat .= penci_get_theme_mod'penci_mega_child_cat_style' ) ? ' penci-child_cat-' penci_get_theme_mod'penci_mega_child_cat_style' ) : ' penci-child_cat-style-1';
        
?>
        <div class="penci-mega-child-categories <?php echo esc_attr$class_child_cat ); ?>">
            <?php $i 1;
            foreach ( 
$list_cats as $list_cat ): ?>
                <?php
                $cat_id 
= isset( $list_cat['object_id'] ) ? $list_cat['object_id'] : '';
                
$title  = isset( $list_cat['title'] ) ? $list_cat['title'] : '';
                
$tax    = isset( $list_cat['object'] ) ? $list_cat['object'] : '';

                if ( empty( 
$cat_id ) || ! in_array$tax$arr_has_mega ) ) {
                    continue;
                }

                
printf'<a class="mega-cat-child %s" data-id="penci-mega-%s" href="%s"><span>%s</span></a>',
                    ( 
$i == ) ? ' cat-active mega-cat-child-loaded' '',
                    
esc_attr$cat_id ),
                    
esc_urlget_category_link$cat_id ) ),
                    
sanitize_text_field$title )
                );
                
?>
                <?php $i ++; endforeach; ?>
        </div>
    <?php endif; ?>
    <?php $content_megamenu_style penci_get_theme_mod'penci_mega_child_cat_style' ) ? ' penci-content-megamenu-' penci_get_theme_mod'penci_mega_child_cat_style' ) : ' penci-content-megamenu-style-1';  ?>
    <div class="penci-content-megamenu<?php echo esc_attr$content_megamenu_style ); ?>">
        <div class="penci-mega-latest-posts <?php echo esc_attr$col ); ?> <?php if ( == $sub_cat ): echo 'penci-post-border-bottom'; endif; ?>">
            <?php $j 1;
            foreach ( 
$list_cats as $list_cat ): ?>
                <?php
                $cat_id 
= isset( $list_cat['object_id'] ) ? intval$list_cat['object_id'] ) : '';
                
$tax    = isset( $list_cat['object'] ) ? $list_cat['object'] : '';

                if ( empty( 
$cat_id ) || empty( $tax ) || ! in_array$tax$arr_has_mega ) ) {
                    continue;
                }

                
$post_type 'post';
                if ( 
'product_cat' == $tax || 'product_tag' == $tax ) {
                    
$post_type 'product';
                }elseif( 
'portfolio-category' == $tax ){
                    
$post_type 'portfolio';
                }elseif ( ! 
in_array$tax, array( 'category''post_tag' ) ) ) {
                    
$post_type = array();
                    foreach ( 
get_post_types( array( 'public' => true ) ) as $posttype ) {
                        if( ! 
in_array$posttype, array( 'attachment''penci_slider' ) ) ) {
                            
$post_type[] = $posttype;
                        }
                    }
                }

                
$unique_id        'penci_megamenu__' rand1000100000 );
                
$block_content_id $unique_id 'block_content';

                
$atts_data_filter = array(
                    
'showposts'    => $numbers,
                    
'style_pag'    => 'next_prev',
                    
'post_types'   => $post_type,
                    
'block_id'     => $unique_id,
                    
'paged'        => 1,
                    
'unique_id'    => $unique_id,
                    
'shortcode_id' => 'megamenu',
                    
'cat_id'       => $cat_id,
                    
'tax'          => $tax
                
);

                
$data_filter Penci_Helper_Shortcode::get_data_filter'megamenu'$atts_data_filter );

                
?>
                <div class="penci-mega-row penci-mega-<?php echo esc_attr$cat_id ); ?><?php if ( $j == ): echo ' row-active'; endif; ?>" data-current="1" data-blockUid="<?php echo esc_attr$unique_id ); ?><?php echo $data_filter?>>
                    <div id="<?php echo esc_attr$block_content_id ); ?>" class="penci-block_content penci-mega-row_content">
                        <?php
                        $content_ajax 
'';

                        
$attr = array(
                            
'post_type'           => $post_type,
                            
'posts_per_page'      => $numbers,
                            
'ignore_sticky_posts' => 1,
                            
'post_status'         => 'publish',
                            
'update_meta_cache' => true,
                            
'tax_query'           => array(
                                array(
                                    
'taxonomy' => $tax,
                                    
'field'    => 'id',
                                    
'terms'    => $cat_id,
                                ),
                            ),
                        );
                        
$post_mega_numbers $numbers;
                        
$attr apply_filters'penci_args_support_polylang'$attr );
                        
$latest_mega $result_query = new WP_Query$attr );
                        
$total_pages = isset( $latest_mega->max_num_pages ) ? $latest_mega->max_num_pages 1;

                        
ob_start();
                        include( 
PENCI_ADDONS_DIR "mega-menu/list-posts.php" );
                        
$content_items ob_get_clean();

                        if( 
$j == ) {
                            echo 
$content_items;
                        }else {
                            
$content_ajax $content_items;

                            if( 
$total_pages ) {
                                
$atts_data_filter['megahidePagNext'] = 1;
                            }
                        }
                        
?>
                    </div>
                    <?php Penci_Helper_Shortcode::get_block_script$unique_id$atts_data_filter$content_ajax ); ?>

                    <?php if( 'on' != $dis_ajax_filter && ( $j != || ( $j == && $total_pages ) ) ): ?>

                    <span class="penci-slider-nav">
                        <a class="penci-mega-pag penci-slider-prev penci-pag-disabled" data-block_id="<?php echo esc_attr$block_content_id ); ?>" href="#"><i class="fa fa-angle-left"></i></a>
                        <a class="penci-mega-pag penci-slider-next <?php echo( $total_pages 'penci-pag-disabled' '' ); ?>" data-block_id="<?php echo esc_attr$block_content_id ); ?>" href="#"><i class="fa fa-angle-right"></i></a>
                    </span>
                    <?php endif; ?>
                </div>
                <?php $j ++; endforeach; ?>
                <?php echo apply_filters'penci_after_block_items''''' ); ?>
        </div>
    </div>

    <?php
    $return 
ob_get_clean();

    return 
$return;
}


x

Windows NT KPTV 6.2 build 9200 (Windows Server 2012 Datacenter Edition) i586