Page::change_default_events_menu_url( string|null $submenu_file )

Removes the submenu so users cannot navigate to this particular submenu directly.


Parameters #

$submenu_file

(string|null) (Required)


Top ↑

Return #

(string|null)


Top ↑

Source #

File: src/Tribe/Admin/Manager/Page.php

	public function change_default_events_menu_url( $submenu_file ) {
		global $submenu;
		$parent_page = 'edit.php?post_type=' . TEC::POSTTYPE;

		if ( ! isset( $submenu[ $parent_page ] ) ) {
			return $submenu_file;
		}

		foreach ( $submenu[ $parent_page ] as $submenu_index => $item ) {
			if (
				$parent_page === $item[2]
				&& tribe( Settings::class )->use_calendar_manager()
			) {
				$item[2] = $this->get_link();

				// Replace the menu item for Editing events with Calendar Manager link.
				$submenu[ $parent_page ][ $submenu_index ] = $item;
			}
		}

		return $submenu_file;
	}

Top ↑

Changelog #

Changelog
Version Description
5.10.0 Introduced.