WOOSL/API_call/do_action

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInPrint this page

Type
Filter

Arguments
(bool) $do_action
(array) $args
(class) $api_object

Description
Allows bypassing the API do action procedure. The filter should be used in conjunction with WOOSL/API_call/early_response or WOOSL/API_call/response to provide custom responses.

Observation
The cache module needs to be off for the filter to trigger.

Example of usage
Ignore the internal API status-check action.

1
2
3
4
5
6
7
8
9
add_filter( 'WOOSL/API_call/do_action', 'WOOSL_API_call_do_action', 10, 3 );
function WOOSL_API_call_do_action ( $do_action, $args, $object )
    {
         
        if ( $args['woo_sl_action'] == 'status-check' )
            $do_action  =   FALSE;
            
        return $do_action;  
    }

By woocommerce-sl, posted on February 9, 2022

Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments