PluginProbe
Themify Builder / trunk
Themify Builder vtrunk
7.8.1 7.8.0 7.7.9 7.7.8 7.7.7 7.7.6 7.7.5 7.7.4 7.7.3 7.7.2 trunk 7.6.0 7.6.1 7.6.2 7.6.3 7.6.4 7.6.5 7.6.6 7.6.7 7.6.8 7.6.9 7.7.0 7.7.1
themify-builder / themify / themify-hooks.php

themify-hooks.php in Themify Builder trunk, at themify/themify-hooks.php

337 lines 12.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /***************************************************************************
3 *
4 * ----------------------------------------------------------------------
5 * DO NOT EDIT THIS FILE
6 * ----------------------------------------------------------------------
7 *
8 * Copyright (C) Themify
9 *
10 * ----------------------------------------------------------------------
11 *
12 *
13 * Layout Hooks:
14 *
15 * themify_body_start
16 *
17 * themify_header_before
18 * themify_header_start
19 * themify_header_end
20 * themify_header_after
21 *
22 * themify_layout_before
23 *
24 * themify_content_before
25 * themify_content_start
26 *
27 * themify_post_before
28 * themify_post_start
29 * themify_post_end
30 * themify_post_after
31 *
32 * themify_comment_before
33 * themify_comment_start
34 * themify_comment_end
35 * themify_comment_after
36 *
37 * themify_content_end
38 * themify_content_after
39 *
40 * themify_sidebar_before
41 * themify_sidebar_start
42 * themify_sidebar_end
43 * themify_sidebar_after
44 *
45 * themify_layout_after
46 *
47 * themify_footer_before
48 * themify_footer_start
49 * themify_footer_end
50 * themify_footer_after
51 *
52 * themify_body_end
53 *
54 * Theme Feature Hooks:
55 *
56 * welcome_before
57 * welcome_start
58 * welcome_end
59 * welcome_after
60 *
61 * slider_before
62 * slider_start
63 * slider_end
64 * slider_after
65 *
66 * footer_slider_before
67 * footer_slider_start
68 * footer_slider_end
69 * footer_slider_after
70 *
71 * themify_product_slider_add_to_cart_before
72 * themify_product_slider_add_to_cart_after
73 *
74 *
75 *
76 *
77 *
78 ***************************************************************************/
79
80 defined( 'ABSPATH' ) || exit;
81
82 /**
83 * Layout Hooks
84 */
85
86 function themify_body_start() {
87 do_action( 'themify_body_start' );
88
89 /* WP 5.2+ */
90 if ( function_exists( 'wp_body_open' ) ) {
91 wp_body_open();
92 }
93 }
94
95 function themify_header_before() { do_action( 'themify_header_before' );}
96 function themify_header_start() { do_action( 'themify_header_start' );}
97 function themify_header_end() { do_action( 'themify_header_end' );}
98 function themify_header_after(){ do_action( 'themify_header_after' );}
99
100 function themify_layout_before() { do_action( 'themify_layout_before' );}
101
102 function themify_content_before (){ do_action( 'themify_content_before' );}
103 function themify_content_start(){ do_action( 'themify_content_start' );}
104
105 function themify_post_before() {
106 $posfix = ! empty( $GLOBALS['themify']->post_module_hook ) ? '_module' : '';
107 do_action( 'themify_post_before' . $posfix );
108 }
109 function themify_post_start() {
110 $posfix = ! empty( $GLOBALS['themify']->post_module_hook ) ? '_module' : '';
111 do_action( 'themify_post_start' . $posfix );
112 }
113 function themify_before_post_image() {
114 $posfix = ! empty( $GLOBALS['themify']->post_module_hook ) ? '_module' : '';
115 do_action( 'themify_before_post_image' . $posfix );
116 }
117 function themify_after_post_image() {
118 $posfix = ! empty( $GLOBALS['themify']->post_module_hook ) ? '_module' : '';
119 do_action( 'themify_after_post_image' . $posfix );
120 }
121 function themify_before_post_title() {
122 $posfix = ! empty( $GLOBALS['themify']->post_module_hook ) ? '_module' : '';
123 do_action( 'themify_before_post_title' . $posfix );
124 }
125 function themify_after_post_title() {
126 $posfix = ! empty( $GLOBALS['themify']->post_module_hook ) ? '_module' : '';
127 do_action( 'themify_after_post_title' . $posfix );
128 }
129 function themify_before_post_content(){
130 $posfix = ! empty( $GLOBALS['themify']->post_module_hook ) ? '_module' : '';
131 do_action( 'themify_before_post_content' . $posfix );
132 }
133 function themify_after_post_content() {
134 $posfix = ! empty( $GLOBALS['themify']->post_module_hook ) ? '_module' : '';
135 do_action( 'themify_after_post_content' . $posfix );
136 }
137 function themify_post_end() {
138 $posfix = ! empty( $GLOBALS['themify']->post_module_hook ) ? '_module' : '';
139 do_action( 'themify_post_end' . $posfix );
140 }
141 function themify_post_after() {
142 $posfix = ! empty( $GLOBALS['themify']->post_module_hook ) ? '_module' : '';
143 do_action( 'themify_post_after' . $posfix );
144 }
145
146 function themify_comment_before() { do_action( 'themify_comment_before' );}
147 function themify_comment_start() { do_action( 'themify_comment_start' );}
148 function themify_comment_end() { do_action( 'themify_comment_end' );}
149 function themify_comment_after() { do_action( 'themify_comment_after' );}
150
151 function themify_content_end() { do_action( 'themify_content_end' );}
152 function themify_content_after() { do_action( 'themify_content_after' );}
153
154 function themify_sidebar_before(){ do_action( 'themify_sidebar_before' );}
155 function themify_sidebar_start (){ do_action( 'themify_sidebar_start' );}
156 function themify_sidebar_end(){ do_action( 'themify_sidebar_end' );}
157 function themify_sidebar_after(){ do_action( 'themify_sidebar_after' );}
158
159 function themify_layout_after() { do_action( 'themify_layout_after' );}
160
161 function themify_footer_before() { do_action( 'themify_footer_before' );}
162 function themify_footer_start() { do_action( 'themify_footer_start' );}
163 function themify_footer_end() { do_action( 'themify_footer_end' );}
164 function themify_footer_after() { do_action( 'themify_footer_after' );}
165
166 function themify_body_end() { do_action( 'themify_body_end' );}
167
168
169 /**
170 * Theme Features Hooks
171 */
172
173 function themify_welcome_before(){ do_action( 'themify_welcome_before' );}
174 function themify_welcome_start(){ do_action( 'themify_welcome_start' );}
175 function themify_welcome_end(){ do_action( 'themify_welcome_end' );}
176 function themify_welcome_after(){ do_action( 'themify_welcome_after' );}
177
178 function themify_slider_before(){ do_action( 'themify_slider_before' );}
179 function themify_slider_start(){ do_action( 'themify_slider_start' );}
180 function themify_slider_end(){ do_action( 'themify_slider_end' );}
181 function themify_slider_after(){ do_action( 'themify_slider_after' );}
182
183 function themify_footer_slider_before(){do_action( 'themify_footer_slider_before' );}
184 function themify_footer_slider_start(){ do_action( 'themify_footer_slider_start' );}
185 function themify_footer_slider_end(){ do_action( 'themify_footer_slider_end' );}
186 function themify_footer_slider_after(){ do_action( 'themify_footer_slider_after' );}
187
188 function themify_sidebar_alt_before(){ do_action( 'themify_sidebar_alt_before' );}
189 function themify_sidebar_alt_start(){ do_action( 'themify_sidebar_alt_start' );}
190 function themify_sidebar_alt_end(){ do_action( 'themify_sidebar_alt_end' );}
191 function themify_sidebar_alt_after(){ do_action( 'themify_sidebar_alt_after' );}
192
193 function themify_product_slider_add_to_cart_before(){ do_action('themify_product_slider_add_to_cart_before'); }
194 function themify_product_slider_add_to_cart_after(){ do_action('themify_product_slider_add_to_cart_after'); }
195 function themify_product_slider_image_start(){ do_action('themify_product_slider_image_start'); }
196 function themify_product_slider_image_end(){ do_action('themify_product_slider_image_end'); }
197 function themify_product_slider_title_start(){ do_action('themify_product_slider_title_start'); }
198 function themify_product_slider_title_end(){ do_action('themify_product_slider_title_end'); }
199 function themify_product_slider_price_start(){ do_action('themify_product_slider_price_start'); }
200 function themify_product_slider_price_end(){ do_action('themify_product_slider_price_end'); }
201
202 function themify_product_cart_image_start(){ do_action('themify_product_cart_image_start'); }
203 function themify_product_cart_image_end(){ do_action('themify_product_cart_image_end'); }
204
205 function themify_shopdock_before(){ do_action('themify_shopdock_before'); }
206 function themify_shopdock_start(){ do_action('themify_shopdock_start'); }
207 function themify_shopdock_end(){ do_action('themify_shopdock_end'); }
208 function themify_shopdock_after(){ do_action('themify_shopdock_after'); }
209
210 function themify_sorting_before(){ do_action('themify_sorting_before'); }
211 function themify_sorting_after(){ do_action('themify_sorting_after'); }
212 function themify_related_products_start(){ do_action('themify_related_products_start'); }
213 function themify_related_products_end(){ do_action('themify_related_products_end'); }
214
215 function themify_breadcrumb_before(){ do_action('themify_breadcrumb_before'); }
216 function themify_breadcrumb_after(){ do_action('themify_breadcrumb_after'); }
217
218 function themify_mobile_menu_start() { do_action( 'themify_mobile_menu_start' ); }
219 function themify_mobile_menu_end() { do_action( 'themify_mobile_menu_end' ); }
220 function themify_search_fields() { do_action( 'themify_search_fields' ); }
221
222
223 /**
224 * Substitute hooks for WooCommerce
225 *
226 * Add support for various WC-related hooks added by the framework
227 */
228 if ( themify_is_woocommerce_active() ) {
229 add_filter( 'woocommerce_product_get_image', 'themify_product_image_hooks', 1000 );
230 add_action( 'woocommerce_before_single_product_summary', 'themify_product_single_image_start_hook', 1 );
231 add_action( 'woocommerce_before_single_product_summary', 'themify_product_single_image_end_hook', 99 );
232 add_filter( 'woocommerce_get_price_html', 'themify_product_price_hooks' );
233 add_action( 'woocommerce_checkout_billing', 'themify_checkout_start_hook', 1 );
234 add_action( 'woocommerce_checkout_billing', 'themify_checkout_end_hook', 100 );
235 add_action( 'themify_sidebar_before', 'themify_ecommerce_sidebar_before_hook' );
236 add_action( 'themify_sidebar_after', 'themify_ecommerce_sidebar_after_hook' );
237 add_action( 'woocommerce_shop_loop_item_title', 'themify_before_product_title_hook', 1 );
238 add_action( 'woocommerce_shop_loop_item_title', 'themify_after_product_title_hook', 100 );
239 add_action( 'woocommerce_before_template_part', 'themify_product_title_start_hook' );
240 add_action( 'woocommerce_after_template_part', 'themify_product_title_end_hook' );
241 }
242
243 function themify_product_title_start_hook( $template_name ) {
244 if ( $template_name === 'single-product/title.php' ) {
245 do_action( 'themify_product_title_start' );
246 } else if ( $template_name === 'single-product/tabs/tabs.php' ) {
247 do_action( 'themify_before_product_tabs' );
248 }
249 }
250 function themify_product_title_end_hook( $template_name ) {
251 if ( $template_name === 'single-product/title.php' ) {
252 do_action( 'themify_product_title_end' );
253 } else if ( $template_name === 'single-product/tabs/tabs.php' ) {
254 do_action( 'themify_after_product_tabs' );
255 }
256 }
257 function themify_before_product_title_hook() {
258 if ( ! is_singular( 'product' ) ) {
259 do_action( 'themify_product_title_start' );
260 }
261 }
262 function themify_after_product_title_hook() {
263 if ( ! is_singular( 'product' ) ) {
264 do_action( 'themify_product_title_end' );
265 }
266 }
267
268 function themify_product_image_hooks( $image ) {
269 ob_start();
270 do_action( 'themify_product_image_start' );
271 echo $image;
272 do_action( 'themify_product_image_end' );
273 return ob_get_clean();
274 }
275
276 function themify_product_price_hooks( $price ) {
277 ob_start();
278 do_action( 'themify_product_price_start' );
279 echo $price;
280 do_action( 'themify_product_price_end' );
281 return ob_get_clean();
282 }
283
284 function themify_product_single_image_start_hook() {
285 do_action( 'themify_product_image_start' );
286 }
287
288 function themify_product_single_image_end_hook() {
289 do_action( 'themify_product_image_end' );
290 }
291
292 function themify_checkout_start_hook() {
293 do_action( 'themify_checkout_start' );
294 }
295
296 function themify_checkout_end_hook() {
297 do_action( 'themify_checkout_end' );
298 }
299
300 function themify_ecommerce_sidebar_before_hook() {
301 if ( is_woocommerce() ) {
302 do_action( 'themify_ecommerce_sidebar_before' );
303 }
304 }
305
306 function themify_ecommerce_sidebar_after_hook() {
307 if ( is_woocommerce() ) {
308 do_action( 'themify_ecommerce_sidebar_after' );
309 }
310 }
311
312 /**
313 * Deprecated hook functions
314 *
315 * These are managed by the Substitute hooks defined above, so the
316 * function hooks are "silenced" (nullified) to prevent double call
317 * of the same hook, should the theme include them.
318 *
319 * @deprecated since 3.5.9
320 */
321 function themify_product_image_start() {}
322 function themify_product_image_end() {}
323 function themify_product_title_start() {}
324 function themify_product_title_end() {}
325 function themify_product_price_start() {}
326 function themify_product_price_end() {}
327 function themify_product_single_price_before() {}
328 function themify_product_single_price_end() {}
329 function themify_product_single_image_before() {}
330 function themify_product_single_image_end() {}
331 function themify_product_single_title_before() {}
332 function themify_product_single_title_end() {}
333 function themify_checkout_start() {}
334 function themify_checkout_end() {}
335 function themify_ecommerce_sidebar_before() {}
336 function themify_ecommerce_sidebar_after() {}
337