um_access_user_custom_homepage

The Ultimate Member um access user custom homepage function.

Description

um_access_user_custom_homepage(); 

Usage

  1. if ( !function_exists( 'um_access_user_custom_homepage' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'ultimate-member/core/um-actions-access.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = um_access_user_custom_homepage(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/core/um-actions-access.php  
  1. function um_access_user_custom_homepage() { 
  2. global $ultimatemember; 
  3.  
  4. if( ! is_user_logged_in() ) return; 
  5. if( ! is_front_page() ) return; 
  6.  
  7. $role_meta = $ultimatemember->query->role_data(um_user'role') ); 
  8.  
  9. if( isset( $role_meta['default_homepage'] ) && $role_meta['default_homepage'] == 0 ) { 
  10. $redirect_to = null; 
  11.  
  12. if( ! empty( $role_meta['redirect_homepage'] ) ) { 
  13. $redirect_to = $role_meta['redirect_homepage']; 
  14. }else{ 
  15. $redirect_to = um_get_core_page('user'); 
  16.  
  17. $redirect_to = $ultimatemember->access->set_referer( $redirect_to, "custom_homepage" ); 
  18. wp_redirect( $redirect_to ); exit; 
  19.  
  20.  
  21.