|

Prevent Agents being redirected to WooCommerce “My Account” Page when trying to login to LatePoint Agent Account

If you have WooCommerce installed – it automatically sends any WP user to the WooCommerce page. You can prevent that for LatePoint agent users by adding this code to your theme’s functions.php file:

add_filter( 'woocommerce_prevent_admin_access', 'latepoint_agent_admin_access', 20, 1 ); 
function latepoint_agent_admin_access( $prevent_access ) {
  if( current_user_can('edit_bookings') || current_user_can('manage_latepoint') ) $prevent_access = false;
  return $prevent_access; 
}
Was this doc helpful?
What went wrong?

We don't respond to the article feedback, we use it to improve our support content.

On this page