Astra_Ext_Advanced_Hooks_Meta::menu_highlight()

Keep the Astra menu open when editing the advanced headers.


Description

Highlights the wanted admin (sub-) menu items for the CPT.


Source

File: addons/advanced-hooks/classes/class-astra-ext-advanced-hooks-meta.php

		public function menu_highlight() {
			global $parent_file, $submenu_file, $post_type;
			if ( ASTRA_ADVANCED_HOOKS_POST_TYPE == $post_type ) :
				$parent_file  = 'themes.php'; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
				$submenu_file = 'edit.php?post_type=' . ASTRA_ADVANCED_HOOKS_POST_TYPE; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited

				/* Same display rule assign notice */
				$option = array(
					'layout'    => 'ast-advanced-hook-layout',
					'location'  => 'ast-advanced-hook-location',
					'exclusion' => 'ast-advanced-hook-exclusion',
					'users'     => 'ast-advanced-hook-users',
				);

				self::hook_same_display_on_notice( ASTRA_ADVANCED_HOOKS_POST_TYPE, $option );
			endif;
		}

Changelog

Changelog
Version Description
1.0.0 Introduced.


User Contributed Notes

You must log in before being able to contribute a note or feedback.