Control whether the current admin page is considered an Alpha Insights (WPD) page.
Used to determine if the user is on an Alpha Insights admin screen (e.g. for loading assets or showing notices). By default, the plugin sets this to true when page matches the main menu slug, settings slug, about/help slug, or getting started slug. This filter lets you include or exclude additional pages.
File: includes/wpd-functions.php
Function: wpdai_is_wpd_page()
| Parameter | Type | Description |
|---|---|---|
| $bool | bool | Whether the current page is considered an Alpha Insights page (default true when page matches built-in slugs) |
Type: bool
True to treat the current admin page as an Alpha Insights page; false otherwise.
add_filter( 'wpd_ai_is_wpd_page', 'exclude_third_party_subpage_from_wpd' );
function exclude_third_party_subpage_from_wpd( $bool ) {
if ( isset( $_GET['page'] ) && $_GET['page'] === 'alpha-insights-third-party' ) {
return false;
}
return $bool;
}
add_filter( 'wpd_ai_is_wpd_page', 'include_my_alpha_page' );
function include_my_alpha_page( $bool ) {
if ( isset( $_GET['page'] ) && $_GET['page'] === 'my-alpha-extension' ) {
return true;
}
return $bool;
}