Changing the default page shown by the Customer Area

By default, the Customer Area page will take the user to his dashboard. In some cases, you may want him to land on another page such as the private files assigned to him. Use our developer tools to know the page slugs.

function cuar_change_default_customer_page( $redirect_to ) {
  // customer-private-files is the slug where we want the user to be redirected to
  return 'customer-private-files';
}
// customer-home is the slug of the redirect page we want to change
add_filter( 'cuar/routing/redirect/root-page-to-slug?slug=' . 'customer-home', 'cuar_change_default_customer_page' );

If the page you want to redirect the user to is not a Customer Area page but another standard page, you can use the more generic hook:

function cuar_change_default_customer_page_url( $redirect_to ) {
  // 120 is the ID of a standard WordPress page we want to show when the user lands on his Customer Area.
  return get_permalink( 120 );
}
// customer-home is the slug of the redirect page we want to change
add_filter( 'cuar/routing/redirect/root-page-to-url?slug=' . 'customer-home', 'cuar_change_default_customer_page_url' );

Hint: our developer tools will help you to find the slug you are looking for.