15
15
* WC tested up to: 9.4
16
16
*/
17
17
18
+ // If this file is called directly, abort.
18
19
if (!defined ('WPINC ' )) {
19
20
die;
20
21
}
@@ -236,11 +237,13 @@ function smarty_remove_dashboard_widgets() {
236
237
}
237
238
}
238
239
239
- /**
240
- * Disable the setup widget.
241
- */
242
- function smarty_disable_setup_widget () {
243
- remove_meta_box ('wc_admin_dashboard_setup ' , 'dashboard ' , 'normal ' );
240
+ if (!function_exists ('smarty_disable_setup_widget ' )) {
241
+ /**
242
+ * Disable the setup widget.
243
+ */
244
+ function smarty_disable_setup_widget () {
245
+ remove_meta_box ('wc_admin_dashboard_setup ' , 'dashboard ' , 'normal ' );
246
+ }
244
247
}
245
248
246
249
if (!function_exists ('smarty_disable_woocommerce_widgets ' )) {
@@ -281,23 +284,27 @@ function smarty_disable_woocommerce_com_notice() {
281
284
}
282
285
}
283
286
284
- /**
285
- * Hide "Marketplace" and "My Subscriptions" submenus.
286
- */
287
- function smarty_hide_woocommerce_menus () {
288
- remove_submenu_page ('woocommerce ' , 'wc-addons ' );
289
- remove_submenu_page ('woocommerce ' , 'wc-addons§ion=helper ' );
287
+ if (!function_exists ('smarty_hide_woocommerce_menus ' )) {
288
+ /**
289
+ * Hide "Marketplace" and "My Subscriptions" submenus.
290
+ */
291
+ function smarty_hide_woocommerce_menus () {
292
+ remove_submenu_page ('woocommerce ' , 'wc-addons ' );
293
+ remove_submenu_page ('woocommerce ' , 'wc-addons§ion=helper ' );
294
+ }
290
295
}
291
296
292
- /**
293
- * Disable WooCommerce Marketing Hub.
294
- */
295
- function smarty_disable_marketing_hub ($ features ) {
296
- $ key = array_search ('marketing ' , $ features );
297
- if ($ key !== false ) {
298
- unset($ features [$ key ]);
297
+ if (!function_exists ('smarty_disable_marketing_hub ' )) {
298
+ /**
299
+ * Disable WooCommerce Marketing Hub.
300
+ */
301
+ function smarty_disable_marketing_hub ($ features ) {
302
+ $ key = array_search ('marketing ' , $ features );
303
+ if ($ key !== false ) {
304
+ unset($ features [$ key ]);
305
+ }
306
+ return $ features ;
299
307
}
300
- return $ features ;
301
308
}
302
309
303
310
if (!function_exists ('smarty_disable_stripe_scripts ' )) {
@@ -314,23 +321,29 @@ function smarty_disable_stripe_scripts() {
314
321
}
315
322
}
316
323
317
- /**
318
- * Deregister unnecessary scripts.
319
- */
320
- function smarty_deregister_woocommerce_scripts () {
321
- wp_dequeue_script ('wc-password-strength-meter ' );
324
+ if (!function_exists ('smarty_deregister_woocommerce_scripts ' )) {
325
+ /**
326
+ * Deregister unnecessary scripts.
327
+ */
328
+ function smarty_deregister_woocommerce_scripts () {
329
+ wp_dequeue_script ('wc-password-strength-meter ' );
330
+ }
322
331
}
323
332
324
- /**
325
- * Increase CSV batch export limit.
326
- */
327
- function smarty_increase_csv_batch_limit () {
328
- return 5000 ;
333
+ if (!function_exists ('smarty_increase_csv_batch_limit ' )) {
334
+ /**
335
+ * Increase CSV batch export limit.
336
+ */
337
+ function smarty_increase_csv_batch_limit () {
338
+ return 5000 ;
339
+ }
329
340
}
330
341
331
- /**
332
- * Clear unused WooCommerce tracker cron job.
333
- */
334
- function smarty_clear_unused_cron_jobs () {
335
- wp_clear_scheduled_hook ('woocommerce_tracker_send_event ' );
342
+ if (!function_exists ('smarty_clear_unused_cron_jobs ' )) {
343
+ /**
344
+ * Clear unused WooCommerce tracker cron job.
345
+ */
346
+ function smarty_clear_unused_cron_jobs () {
347
+ wp_clear_scheduled_hook ('woocommerce_tracker_send_event ' );
348
+ }
336
349
}
0 commit comments