PluginProbe
Boxzilla – WordPress Popup Builder / 3.4.4
Boxzilla – WordPress Popup Builder v3.4.4
3.4.11 3.4.10 3.4.9 3.4.3 3.4.4 3.4.5 3.4.6 3.4.7 3.4.8 trunk 3.0 3.0.1 3.0.2 3.0.3 3.1 3.1.1 3.1.10 3.1.11 3.1.12 3.1.13 3.1.14 3.1.15 3.1.16 3.1.17 3.1.18 All 72 releases
boxzilla / src / default-filters.php

default-filters.php in Boxzilla – WordPress Popup Builder 3.4.4, at src/default-filters.php

37 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 defined('ABSPATH') or exit;
4
5 add_filter('boxzilla_box_content', 'wptexturize');
6 add_filter('boxzilla_box_content', 'convert_smilies');
7 add_filter('boxzilla_box_content', 'convert_chars');
8 add_filter('boxzilla_box_content', 'wpautop');
9 add_filter('boxzilla_box_content', 'shortcode_unautop');
10 add_filter('boxzilla_box_content', 'do_shortcode', 11);
11
12 /**
13 * Allow Jetpack Photon to filter on Boxzilla box content.
14 */
15 if (class_exists('Jetpack') && class_exists('Jetpack_Photon') && method_exists('Jetpack', 'is_module_active') && Jetpack::is_module_active('photon')) {
16 add_filter('boxzilla_box_content', [ 'Jetpack_Photon', 'filter_the_content' ], 999999);
17 }
18
19 /**
20 * Filter nav menu items to use an onclick event instead of a href attribute.
21 */
22 add_filter(
23 'nav_menu_link_attributes',
24 function ($atts) {
25 if (isset($atts['href']) && strpos($atts['href'], '#boxzilla-') !== 0) {
26 return $atts;
27 }
28
29 $id = substr($atts['href'], strlen('#boxzilla-'));
30 $atts['onclick'] = "Boxzilla.show({$id}); return false;";
31 $atts['href'] = '';
32 return $atts;
33 },
34 10,
35 1
36 );
37