get_page_by_path


get_page_by_path ( $page_path, $output = OBJECT, $post_type = 'page' )

Parameters:
  • (string) page_path Page path.
  • (string) output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which correspond to a WP_Post object, an associative array, or a numeric array, respectively. Default OBJECT.
  • (string|array) post_type Optional. Post type or array of post types. Default 'page'.
Returns:
  • (WP_Post|array|null) WP_Post (or array) on success, or null on failure.
Defined at:

Description

Retrieves a page given its path.

Related Functions

get_site_by_path, get_page_by_title, get_category_by_path, get_network_by_path, get_page_template

Top Google Results

User discussions

wpseek mobile