Skip to content
Docs
Get RestroPress

Filter

rpress_account_page_id

Updated
On this page

Filters the ID of the page used as the customer account page.

rpress_account_page_id() looks for a published page containing the [rpress_customer_dashboard] shortcode (or [customer_dashboard]) and caches the found ID for a day. The filter runs on every call, after the cache, so the filtered value is not stored. The ID is used to register section URLs and to build account links.

Available since RestroPress 3.5.1.

Parameters#

ParameterTypeDescription
$page_idintFound page ID, 0 when there is none.

Return value#

int. Account page ID.

Example#

add_filter( 'rpress_account_page_id', 'my_account_page_id', 10, 1 );
function my_account_page_id( $page_id ) {
	$custom = (int) get_option( 'my_account_page_id', 0 );
	return $custom ? $custom : $page_id;
}

Source#

Applied in:

  • includes/features/account/loader.php (line 180), in rpress_account_page_id()

See also#

Was this page helpful?