Inventory_Presser_Allow_Inventory_As_Home_Page::find_page_id()

find_page_id

Description Description

Finds the ID of the page this plugin creates to allow the user to pick the inventory listing as a home page option.


Top ↑

Return Return

(int) The ID of the page or -1 if the page is not found.


Top ↑

Source Source

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

	static function find_page_id() {
		$pages = get_pages(
			array(
				'meta_key'   => self::PAGE_META_KEY,
				'meta_value' => '1',
			)
		);

		if ( empty( $pages ) ) {
			return -1;
		}

		return $pages[0]->ID;
	}