Filter
rpress_account_endpoints
On this page
Filters the URL slugs of the customer account sections.
Receives the slugs of all sections that declare an endpoint, before they are passed through sanitize_title(). Use it to rename or translate a slug such as "orders". The slugs are used for rewrite rules, section links and detecting the current section. An empty value leaves that section without its own URL.
Available since RestroPress 3.5.1.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$slugs | array | Section ID => URL slug. |
Return value#
array. Section ID => slug.
Example#
add_filter( 'rpress_account_endpoints', 'my_account_slugs', 10, 1 );
function my_account_slugs( $slugs ) {
if ( isset( $slugs['orders'] ) ) {
$slugs['orders'] = 'bestellungen';
}
return $slugs;
}
Notes#
Add the filter before init priority 20, when the rewrite rules are registered.
Source#
Applied in:
includes/features/account/loader.php(line 104), inrpress_account_filter_slugs()
See also#
Was this page helpful?
