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
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744574697a4581665.html
评论列表(0条)