VAT
Your cart

Your cart is empty.

Recipe: keep Addofy off a screen

Goal: one admin screen, for example a page of a plugin with its own full-page interface, keeps its native WordPress look.

What exclusion does

On an excluded screen Addofy stays off: no Addofy styling, no Addofy assets. The screen looks native.

In code, one screen

add_filter( 'adba_is_excluded_screen', static function ( bool $excluded, string $screen_id ) {
	if ( 'toplevel_page_myplugin' === $screen_id ) {
		return true;
	}
	return $excluded;
}, 10, 2 );

The filter also receives the Screen object as a third argument. The value you receive is already true when the screen is on the exclusion list or is a full-screen app such as the Customizer or the site editor. Return it unchanged for screens that are not yours.

For a whole plugin

If a plugin has several screens, write a compatibility adapter with excluded_fragments(): any screen whose id contains one of the fragments is excluded.

Without code

A site administrator can exclude screens in the Addofy settings.

Safe mode

Safe mode always wins. While it is active (?adba_safe=1 or the ADBA_SAFE_MODE constant), Addofy is off everywhere, and no filter can switch it back on.

Ready to connect your AI to real tools?

Start free trial