Skip to main content

benecaster_tour_reprompt_enabled

Filter Free

Decides whether a user who completed an earlier version of a guided tour is offered it again. When a tour’s author raises its contentVersion, everyone who finished an older version sees a bar at the top of the next Benecaster screen: “The {tour} tour has been updated since you last took it.”, with Take the tour and No thanks. Return false to stop that bar, for every tour (__return_false), for one tour, or for some users.

Only the offer stops. The tour still runs from the Tours panel, completions are still recorded, and a later version bump is not offered either while your callback says false.

It is called once per admin page load, and only for the tours the user has completed. Tours are registered in JavaScript, so the server cannot list them, but only a completed tour can ever be offered again. Your callback is never asked about a tour the user has not taken, and that is not a bug.

Only a literal false switches the offer off. A callback that forgets to return hands back null, which leaves the offer on.

Parameters

Name Type Default Description
$enabled bool — Whether to offer the updated tour. Default true
$tour_id string — The tour's id, for example overview
$user_id int — The user who would see the offer

Returns: bool

Example

// Never re-offer one add-on's tour.
add_filter( 'benecaster_tour_reprompt_enabled', function ( bool $enabled, string $tour_id ): bool {
    return 'my-addon' === $tour_id ? false : $enabled;
}, 10, 2 );

Notes

Authors make a tour eligible by raising contentVersion on its definition. See Register a guided product tour from an add-on JS bundle.

Affects

  • Updated-tour bar

Need this built rather than just documented? See our services →