Inventory_Presser_Allow_Inventory_As_Home_Page::hide_page_from_edit_list( WP_Query $query )

hide_page_from_edit_list


Description Description

Prevents the page this plugin creates from showing up in the list of pages while editing in the dashboard. We need a page to exist in order to allow users to choose it as their home page, but we don't want them to see an actual page in the list, because the Inventory listing is not a page, it's a custom post type archive.


Top ↑

Parameters Parameters

$query

(WP_Query) (Required) An instance of the WP_Query class


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/class-allow-inventory-as-home-page.php

	function hide_page_from_edit_list( $query )
	{
		global $pagenow, $post_type;
		if( is_admin() && 'edit.php' == $pagenow && 'page' == $post_type )
		{
			$query->query_vars['post__not_in'] = array( self::find_page_id() );
		}
	}