Profile::page_template( string $template )

Description #

Override user page template.

Parameters #

  • $template
    string (Required) Template file.

Changelog #

VersionDescription
4.1.0Introduced.

Source #

File: addons/profile/profile.php

	public function page_template( $template ) {
		if ( is_author() && 'user' === get_query_var( 'ap_page' ) ) {
			$user_slug = ap_opt( 'user_page_id' );
			return locate_template( array( 'page-' . $user_slug . '.php', 'page.php' ) );
		}

		return $template;
	}

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