English (United Kingdom)

apply_filters_ref_array( 'vikappointments_fetch_status_save_subscription_order', bool $result, string &$status, string &$comment )

Fires after evaluating the default status code.


Description

Trigger hook to manipulate the order status at runtime.


Parameters

$result

(bool)  True on success, false otherwise.

&$status

(string)  The status code to use.

&$comment

(string)  An optional status comment.


Example

/**
 * Trigger hook to manipulate the order status at runtime.
 *
 * @param  boolean  $result    True on success, false otherwise.
 * @param  string   &$status   The currently fetched order status.
 * @param  string   &$comment  An optional status comment to be used.
 */
add_filter('vikappointments_fetch_status_save_subscription_order', function($result, &$status, &$comment)
{
    // auto-confirm order
    $status = 'C';
    // define a custom comment
    $comment = 'Order confirmed by a third-party plugin';

    return $result;
}, 10, 3);

Changelog

Version Description
1.2 Introduced.
Last Update: 2021-08-05
Helpful?