Opens in a new tab
A picture of Jeff Brigman
I CODE TODAY FOR
A BETTER TOMORROW

Glossary Term

get_page_by_path()

3 tags 1 category

get_page_by_path() — Retrieves a page given its path.

Inputs: $page_path (string): Page path. $output (string): 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. $post_type (string|array): 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.

Term Connections

Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.

Loading term connections…