aioseo_flyout_menu_enable


Purpose
& version added

This filter can be used to enable or disable the Flyout menu.

Arguments (1)

  1. $enabled (boolean) – Whether the menu is enabled or not.

Example code snippet

The code snippet below is just an example of how this filter can be used. In the example below, we’ll disable the menu for all roles except for the administrator.

// Removes the Flyout menu for non-administrator users.
add_filter( 'aioseo_flyout_menu_enable', 'aioseo_filter_flyout_menu_enable' );
function aioseo_filter_flyout_menu_enable( $enabled ) {
	if ( ! aioseo()->access->isAdmin() ) {
		$enabled = false;
	}

	return $enabled;
}

Changelog

VersionDescription
4.1.5Introduced.