ap_register_page( string $page_slug, string $page_title, callable $func, bool $show_in_menu = true, bool $private = false )

Description #

Register anspress pages.

Parameters #

  • $page_slug
    string (Required) slug for links.
  • $page_title
    string (Required) Page title.
  • $func
    callable (Required) Hook to run when shortcode is found.
  • $show_in_menu
    bool (Optional) User can add this pages to their WordPress menu from appearance->menu->AnsPress. Default value: true
  • $private
    bool (Optional) Only show to currently logged in user. Default value: false

Changelog #

VersionDescription
2.0.1Introduced.

Source #

File: includes/theme.php

function ap_register_page( $page_slug, $page_title, $func, $show_in_menu = true, $private = false ) {
	anspress()->pages[ $page_slug ] = array(
		'title'        => $page_title,
		'func'         => $func,
		'show_in_menu' => $show_in_menu,
		'private'      => $private,
	);
}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment