PluginProbe ʕ •ᴥ•ʔ
Strong Testimonials / 3.3.2
Strong Testimonials v3.3.2
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 month ago strong-testimonials-beaver-block 1 year ago submodules 8 months 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-defaults.php 1 month ago class-strong-testimonials-form.php 1 month ago class-strong-testimonials-order.php 1 year ago class-strong-testimonials-privacy.php 1 year ago class-strong-testimonials-render.php 1 month ago class-strong-testimonials-templates.php 1 year ago class-strong-testimonials-view-shortcode.php 1 week ago class-strong-testimonials-view-widget.php 1 year ago class-strong-view-display.php 1 day ago class-strong-view-form.php 1 day ago class-strong-view-slideshow.php 1 day ago class-strong-view.php 1 day ago class-walker-strong-category-checklist-front.php 1 year ago deprecated.php 1 year ago filters.php 1 month ago functions-activation.php 1 month ago functions-content.php 11 months ago functions-image.php 5 months ago functions-rating.php 1 year ago functions-template-form.php 1 week ago functions-template.php 4 months ago functions-views.php 1 year ago functions.php 1 month ago l10n-polylang.php 1 year ago l10n-wpml.php 1 year ago post-types.php 1 week ago retro.php 1 year ago scripts.php 1 month ago
filters.php
197 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 $saved_value = isset( $options['remove_whitespace'] ) ? (bool) $options['remove_whitespace'] : true;
19 if ( apply_filters( 'wpmtst_remove_whitespace_enabled', $saved_value ) ) {
20 $html = preg_replace( '~>\s+<~', '><', $html );
21 }
22
23 return $html;
24 }
25 add_filter( 'strong_view_html', 'wpmtst_remove_whitespace' );
26 add_filter( 'strong_view_form_html', 'wpmtst_remove_whitespace' );
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', 'convert_smilies', 20 );
49
50 add_filter( 'wpmtst_the_excerpt', 'wptexturize' );
51 add_filter( 'wpmtst_the_excerpt', 'convert_smilies' );
52 add_filter( 'wpmtst_the_excerpt', 'convert_chars' );
53 add_filter( 'wpmtst_the_excerpt', 'wpautop' );
54 add_filter( 'wpmtst_the_excerpt', 'shortcode_unautop' );
55 add_filter( 'wpmtst_the_excerpt', 'convert_smilies', 20 );
56 }
57 add_action( 'init', 'wpmtst_content_filters' );
58
59 function wpmtst_add_allowed_tags( $tags ) {
60
61 // iframe
62 $tags['iframe'] = array(
63 'src' => true,
64 'height' => true,
65 'width' => true,
66 'frameborder' => true,
67 'allowfullscreen' => true,
68 'style' => true,
69 'data-*' => true,
70 'hidden' => true,
71 );
72 // form fields - input
73 $tags['input'] = array(
74 'class' => true,
75 'id' => true,
76 'name' => true,
77 'value' => true,
78 'type' => true,
79 'placeholder' => true,
80 'required' => true,
81 'checked' => true,
82 'title' => true,
83 'style' => true,
84 'data-*' => true,
85 'hidden' => true,
86 );
87 // textarea
88 $tags['textarea'] = array(
89 'class' => true,
90 'id' => true,
91 'name' => true,
92 'value' => true,
93 'type' => true,
94 'placeholder' => true,
95 'required' => true,
96 'style' => true,
97 'data-*' => true,
98 'hidden' => true,
99 );
100 // select
101 $tags['select'] = array(
102 'class' => true,
103 'id' => true,
104 'name' => true,
105 'value' => true,
106 'type' => true,
107 'style' => true,
108 'data-*' => true,
109 'hidden' => true,
110 );
111 // select options
112 $tags['option'] = array(
113 'selected' => true,
114 'class' => true,
115 'id' => true,
116 'name' => true,
117 'value' => true,
118 'style' => true,
119 'data-*' => true,
120 'hidden' => true,
121 );
122 $tags['optgroup'] = array(
123 'class' => true,
124 'id' => true,
125 'name' => true,
126 'value' => true,
127 'label' => true,
128 'style' => true,
129 'data-*' => true,
130 'hidden' => true,
131 );
132 $tags['source'] = array(
133 'type' => true,
134 'src' => true,
135 );
136
137 $tags['span']['hidden'] = true;
138
139 $tags['img']['srcset'] = true;
140 $tags['img']['sizes'] = true;
141
142 $tags['div']['data-*'] = true;
143
144 $tags['noscript'] = array();
145
146 $tags['style'] = array(
147 'types' => true,
148 );
149
150 return $tags;
151 }
152 add_filter( 'wp_kses_allowed_html', 'wpmtst_add_allowed_tags' );
153
154
155 function wpmtst_safe_style_css( $styles ) {
156 $styles[] = 'display';
157 return $styles;
158 }
159 add_filter( 'safe_style_css', 'wpmtst_safe_style_css' );
160
161
162 /**
163 * Change single testimonial slug.
164 */
165 add_filter( 'wpmtst_post_type', 'wpmtst_change_testimonial_slug' );
166 function wpmtst_change_testimonial_slug( $args ) {
167
168 $options = get_option( 'wpmtst_options' );
169 $saved_slug = isset( $options['single_testimonial_slug'] ) ? $options['single_testimonial_slug'] : '';
170 $slug = apply_filters( 'wpmtst_single_testimonial_slug', $saved_slug );
171
172 if ( '' !== $slug ) {
173 $args['rewrite']['slug'] = $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 $saved_value = isset( $options['disable_rewrite'] ) && $options['disable_rewrite'];
188 $disable_rewrite = apply_filters( 'wpmtst_disable_rewrite', $saved_value );
189
190 if ( $disable_rewrite ) {
191 $args['rewrite'] = false;
192 $args['public'] = false;
193 }
194
195 return $args;
196 }
197