plugins - Easiest way to loadfire a handful of functions, IF checkbox is checked?

I have a custom checkbox field on the general settings of my Woocommerce products.I also have 5 or so functions that all

I have a custom checkbox field on the general settings of my Woocommerce products.

I also have 5 or so functions that all do what I want them to do. These are currently housed in my child theme's functions.php file.

I would like to have it so, once the checkbox is checked on the Product Admin Page and it is saved... all of those functions now become active and affect only the said product.

Is there an easier, quick way of doing this rather than adding the condition if ( 'yes' == $custom_field && $otherstuff ) on every single function manually?

I have a custom checkbox field on the general settings of my Woocommerce products.

I also have 5 or so functions that all do what I want them to do. These are currently housed in my child theme's functions.php file.

I would like to have it so, once the checkbox is checked on the Product Admin Page and it is saved... all of those functions now become active and affect only the said product.

Is there an easier, quick way of doing this rather than adding the condition if ( 'yes' == $custom_field && $otherstuff ) on every single function manually?

Share Improve this question asked Apr 12, 2020 at 16:35 Chaz PierceChaz Pierce 112 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0
function start_all(){
    $option = get_option($name);
    if ( 'yes' == $custom_field && $otherstuff ){
         function_1();
         function_2();
         function_3();
    }

}

plase it in functions and call whit hook you need - this is just an example

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744574697a4581665.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信