Settings::filter_settings_tab_url( string $url, string $page, string $tab )
Filters the settings tab URL.
Contents
Parameters
- $url
-
(string) (Required) The URL of the settings tab.
- $page
-
(string) (Required) The slug of the page.
- $tab
-
(string) (Required) The slug of the settings tab.
Return
(string) $url The modified URL of the tab.
Source
File: src/Tribe/Admin/Settings.php
public function filter_settings_tab_url( $url, $page, $tab ) {
// Bail if `tribe_events` doesn't exist.
if ( ! post_type_exists( Plugin::POSTTYPE ) ) {
return $url;
}
if ( static::$settings_page_id !== $page ) {
return $url;
}
$current_page = is_network_admin() ? network_admin_url( 'settings.php' ) : admin_url( 'edit.php' );
$url = add_query_arg(
[
'post_type' => Plugin::POSTTYPE,
'page' => $page,
'tab' => $tab,
],
$current_page
);
return $url;
}
Changelog
| Version | Description |
|---|---|
| 5.15.0 | Introduced. |