ap_page( string $current_page = '' )

Description #

Output current AnsPress page.

Parameters #

  • $current_page
    string (Optional) Pass current page to override. Default value: ''

Changelog #

VersionDescription
4.1.9Fixed: page attribute not working.
2.0.0Introduced.

Source #

File: includes/theme.php

function ap_page( $current_page = '' ) {
	$pages = anspress()->pages;

	if ( empty( $current_page ) ) {
		$current_page = ap_current_page();
		$current_page = '' === $current_page ? 'base' : $current_page;
	}

	if ( isset( $pages[ $current_page ]['func'] ) ) {
		call_user_func( $pages[ $current_page ]['func'] );
	} else {
		global $wp_query;
		$wp_query->set_404();
		status_header( 404 );
		include ap_get_theme_location( 'not-found.php' );
	}
}

Leave a Reply

Your email address will not be published. Required fields are marked *

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

Add your comment