PluginProbe ʕ •ᴥ•ʔ
Strong Testimonials / 3.2.8
Strong Testimonials v3.2.8
3.3.6 3.3.5 3.3.4 3.3.3 3.3.2 3.3.1 trunk 1.0.1 2.30.9 2.31.10 2.32 2.32.1 2.32.2 2.32.3 2.32.4 2.33 2.34 2.35 2.36 2.37 2.38 2.38.1 2.39 2.39.1 2.39.2 2.39.3 2.40.0 2.40.1 2.40.2 2.40.3 2.40.4 2.40.5 2.40.6 2.40.7 2.41.0 2.41.1 2.50.0 2.50.1 2.50.2 2.50.3 2.50.4 2.51.0 2.51.1 2.51.2 2.51.3 2.51.4 2.51.5 2.51.6 2.51.7 2.51.8 2.51.9 3.0.0 3.0.1 3.0.2 3.0.3 3.1.0 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 3.1.19 3.1.2 3.1.20 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.10 3.2.11 3.2.12 3.2.13 3.2.14 3.2.15 3.2.16 3.2.17 3.2.18 3.2.19 3.2.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 3.3.0
strong-testimonials / includes / filters.php
strong-testimonials / includes Last commit date
elementor 1 year ago logs 1 year ago strong-testimonials-beaver-block 1 year ago submodules 1 year ago class-strong-gutemberg.php 1 year ago class-strong-log.php 1 year ago class-strong-mail.php 1 year ago class-strong-testimonials-average-shortcode.php 1 year ago class-strong-testimonials-count-shortcode.php 1 year ago class-strong-testimonials-form.php 1 year ago class-strong-testimonials-order.php 1 year ago class-strong-testimonials-privacy.php 1 year ago class-strong-testimonials-render.php 1 year ago class-strong-testimonials-templates.php 1 year ago class-strong-testimonials-view-shortcode.php 1 year ago class-strong-testimonials-view-widget.php 1 year ago class-strong-view-display.php 1 year ago class-strong-view-form.php 1 year ago class-strong-view-slideshow.php 1 year ago class-strong-view.php 1 year ago class-walker-strong-category-checklist-front.php 1 year ago deprecated.php 1 year ago filters.php 1 year ago functions-activation.php 1 year ago functions-content.php 1 year ago functions-image.php 1 year ago functions-rating.php 1 year ago functions-template-form.php 1 year ago functions-template.php 1 year ago functions-views.php 1 year ago functions.php 1 year ago l10n-polylang.php 1 year ago l10n-wpml.php 1 year ago post-types.php 1 year ago retro.php 1 year ago scripts.php 1 year ago
filters.php
195 lines
1 <?php
2 /**
3 * Filters
4 */
5
6 /**
7 * Remove whitespace between tags. Helps prevent double wpautop in plugins
8 * like Posts For Pages and Custom Content Shortcode.
9 *
10 * @param $html
11 *
12 * @since 2.3
13 *
14 * @return mixed
15 */
16 function wpmtst_remove_whitespace( $html ) {
17 $options = get_option( 'wpmtst_options' );
18 if ( $options['remove_whitespace'] ) {
19 $html = preg_replace( '~>\s+<~', '><', $html );
20 }
21
22 return $html;
23 }
24 add_filter( 'strong_view_html', 'wpmtst_remove_whitespace' );
25 add_filter( 'strong_view_form_html', 'wpmtst_remove_whitespace' );
26
27
28 /**
29 * Content filters.
30 *
31 * @since 2.33.0 Moved to `init` action.
32 */
33 function wpmtst_content_filters() {
34
35 add_filter( 'wpmtst_the_content', array( $GLOBALS['wp_embed'], 'run_shortcode' ), 8 );
36 add_filter( 'wpmtst_the_content', array( $GLOBALS['wp_embed'], 'autoembed' ), 8 );
37 add_filter( 'wpmtst_the_content', 'wptexturize' );
38 add_filter( 'wpmtst_the_content', 'wpautop' );
39 add_filter( 'wpmtst_the_content', 'shortcode_unautop' );
40 add_filter( 'wpmtst_the_content', 'prepend_attachment' );
41
42 if ( version_compare( get_bloginfo( 'version' ), '5.5', '>=' ) ) {
43 add_filter( 'wpmtst_the_content', 'wp_filter_content_tags' );
44 } else {
45 add_filter( 'wpmtst_the_content', 'wp_make_content_images_responsive' );
46 }
47
48 add_filter( 'wpmtst_the_content', 'do_shortcode', 11 );
49 add_filter( 'wpmtst_the_content', 'convert_smilies', 20 );
50
51 add_filter( 'wpmtst_the_excerpt', 'wptexturize' );
52 add_filter( 'wpmtst_the_excerpt', 'convert_smilies' );
53 add_filter( 'wpmtst_the_excerpt', 'convert_chars' );
54 add_filter( 'wpmtst_the_excerpt', 'wpautop' );
55 add_filter( 'wpmtst_the_excerpt', 'shortcode_unautop' );
56 add_filter( 'wpmtst_the_excerpt', 'do_shortcode', 11 );
57 add_filter( 'wpmtst_the_excerpt', 'convert_smilies', 20 );
58 }
59 add_action( 'init', 'wpmtst_content_filters' );
60
61 function wpmtst_add_allowed_tags( $tags ) {
62
63 // iframe
64 $tags['iframe'] = array(
65 'src' => true,
66 'height' => true,
67 'width' => true,
68 'frameborder' => true,
69 'allowfullscreen' => true,
70 'style' => true,
71 'data-*' => true,
72 'hidden' => true,
73 );
74 // form fields - input
75 $tags['input'] = array(
76 'class' => true,
77 'id' => true,
78 'name' => true,
79 'value' => true,
80 'type' => true,
81 'placeholder' => true,
82 'required' => true,
83 'checked' => true,
84 'title' => true,
85 'style' => true,
86 'data-*' => true,
87 'hidden' => true,
88 );
89 // textarea
90 $tags['textarea'] = array(
91 'class' => true,
92 'id' => true,
93 'name' => true,
94 'value' => true,
95 'type' => true,
96 'placeholder' => true,
97 'required' => true,
98 'style' => true,
99 'data-*' => true,
100 'hidden' => true,
101 );
102 // select
103 $tags['select'] = array(
104 'class' => true,
105 'id' => true,
106 'name' => true,
107 'value' => true,
108 'type' => true,
109 'style' => true,
110 'data-*' => true,
111 'hidden' => true,
112 );
113 // select options
114 $tags['option'] = array(
115 'selected' => true,
116 'class' => true,
117 'id' => true,
118 'name' => true,
119 'value' => true,
120 'style' => true,
121 'data-*' => true,
122 'hidden' => true,
123 );
124 $tags['optgroup'] = array(
125 'class' => true,
126 'id' => true,
127 'name' => true,
128 'value' => true,
129 'label' => true,
130 'style' => true,
131 'data-*' => true,
132 'hidden' => true,
133 );
134 $tags['source'] = array(
135 'type' => true,
136 'src' => true,
137 );
138
139 $tags['span']['hidden'] = true;
140
141 $tags['img']['srcset'] = true;
142 $tags['img']['sizes'] = true;
143
144 $tags['div']['data-*'] = true;
145
146 $tags['noscript'] = array();
147
148 $tags['style'] = array(
149 'types' => true,
150 );
151
152 return $tags;
153 }
154 add_filter( 'wp_kses_allowed_html', 'wpmtst_add_allowed_tags' );
155
156
157 function wpmtst_safe_style_css( $styles ) {
158 $styles[] = 'display';
159 return $styles;
160 }
161 add_filter( 'safe_style_css', 'wpmtst_safe_style_css' );
162
163
164 /**
165 * Change single testimonial slug.
166 */
167 add_filter( 'wpmtst_post_type', 'wpmtst_change_testimonial_slug' );
168 function wpmtst_change_testimonial_slug( $args ) {
169
170 $options = get_option( 'wpmtst_options' );
171
172 if ( isset( $options['single_testimonial_slug'] ) && '' !== $options['single_testimonial_slug'] ) {
173 $args['rewrite']['slug'] = $options['single_testimonial_slug'];
174 }
175
176 return $args;
177 }
178
179
180 /**
181 * Disable custom post url
182 */
183 add_filter( 'wpmtst_post_type', 'wpmtst_disable_permalink', 999 );
184 function wpmtst_disable_permalink( $args ) {
185
186 $options = get_option( 'wpmtst_options' );
187
188 if ( isset( $options['disable_rewrite'] ) && $options['disable_rewrite'] ) {
189 $args['rewrite'] = false;
190 $args['public'] = false;
191 }
192
193 return $args;
194 }
195