admin管理员组文章数量:1391995
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?
1 Answer
Reset to default 0function 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
本文标签: pluginsEasiest way to loadfire a handful of functionsIF checkbox is checked
版权声明:本文标题:plugins - Easiest way to loadfire a handful of functions, IF checkbox is checked? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744574697a2613550.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论