Required_Page::ensure_page_exists()

Summary

Ensure that there is a page designated as this page at all times. Creates one if necessary.


Return

(void)


Source

File: src/BigCommerce/Pages/Required_Page.php

	public function ensure_page_exists() {
		$post_id = $this->get_post_id();
		if ( ! empty( $post_id ) ) {
			return; // already exists
		}
		$new_id = $this->match_existing_post();
		if ( empty( $new_id ) ) {
			$new_id = $this->create_post();
		}
		if ( ! empty( $new_id ) ) {
			$this->set_post_id( $new_id );
		}
	}

User Contributed Notes

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