acf_options_page::add_sub_pagepublicACF 5.6.0

description

Method of the class: acf_options_page{}

No Hooks.

Returns

$post_id. (int)

Usage

$acf_options_page = new acf_options_page();
$acf_options_page->add_sub_page( $page );
$page(required)
.

Changelog

Since 5.6.0 Introduced.

acf_options_page::add_sub_page() code ACF 6.8.8

function add_sub_page( $page ) {

	// validate
	$page = $this->validate_page( $page );

	// default parent
	if ( ! $page['parent_slug'] ) {
		$page['parent_slug'] = 'acf-options';
	}

	// create default parent if not yet exists
	if ( $page['parent_slug'] == 'acf-options' && ! $this->get_page( 'acf-options' ) ) {
		$this->add_page( '' );
	}

	// return
	return $this->add_page( $page );
}