Widget_Abstract::toggle_hooks( bool $toggle, string $location = 'display' )

Toggles hooks for the widget, will be deactivated after the rendering has happened.


Parameters

$toggle

(bool) (Required) Whether to turn the hooks on or off.

$location

(string) (Optional) If we are doing the form (admin) or the display (front end)

Default value: 'display'


Top ↑

Return

(void)


Top ↑

Source

File: src/Tribe/Widget/Widget_Abstract.php

	public function toggle_hooks( $toggle ) {
		if ( $toggle ) {
			$this->add_hooks();
		} else {
			$this->remove_hooks();
		}

		/**
		 * Fires after widget was setup while rendering a widget.
		 *
		 * @since 4.13.0
		 *
		 * @param bool   $toggle Whether the hooks should be turned on or off. This value is `true` before a widget
		 *                       HTML is rendered and `false` after the widget HTML rendered.
		 * @param static $this   The widget object that is toggling the hooks.
		 */
		do_action( 'tribe_shortcode_toggle_hooks', $toggle, $this );
	}

Top ↑

Changelog

Changelog
Version Description
4.13.0 Introduced.