English (United Kingdom)
Knowledge Base  >  Vik Restaurants  >  Hooks  >  Wizard  >  After Setup

do_action( 'vikrestaurants_after_wizard_setup', Wizard $wizard )

Fires after completing the wizard setup.


Description

Trigger hook after completing the wizard setup. This is useful, in example, to rearrange the registered steps.


Parameters

$wizard

(Wizard)  The instance handling the wizard steps. This class is part of the E4J\VikRestaurants\Wizard namespace.


Example

The example below provides the instantiation of the "test" step located within the VikWP plugin.

/wp-content/plugins/vikwp/wizard/step.php
/** 
 * Trigger event after completing the wizard setup.
 * This is useful, in example, to rearrange the registered steps.
 *
 * @param  Wizard  $wizard  The wizard instance.
 */
add_action('vikrestaurants_after_setup_wizard', function($wizard)
{
    // register test step
    $wizard->addStep(new VREWizardStepTest);

    // add dependency with the "System" and "Sections" step, meaning that this step
    // won't be accessible until both the mentioned steps have been completed
    $wizard['test']->addDependency($wizard['system']);
    $wizard['test']->addDependency($wizard['sections']);
});

Changelog

Version Description
1.3 The hook has been changed from a filter into an action as the plugin didn't need a return value anymore.
The $wizard argument is no more passed by reference.
1.1 Introduced.
Last Update: 2023-12-15
Helpful?
See Also: