• Please add this code to current version. This allows us to set a different redirect path if we need to. Please let me know if you want to change the name of the hook. Id like to be able to use this code and be able to keep upto date.

    	function block_screen_edit_profile() {
    		global $bp, $current_user;
    		wp_get_current_user();
    		if($current_user->ID) {
    			if( ! in_array($bp->action_variables[1], $this->user_allowed_xprofile_groups) ) {
    				$profile_redirect = do_action('buddypress_xprofiles_acl_path');
    
    				if ($profile_redirect) {
    					bp_core_redirect( $profile_redirect );
    				} else {
    					bp_core_redirect( $bp->displayed_user->domain . BP_XPROFILE_SLUG . '/edit/group/1' );
    				}
    			}
    		}
    	}
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Michael

    (@mgparisi)

    Woops, this one is the right one… Tested and works. Changed name of the filter to match the standard.

    	function block_screen_edit_profile() {
    		global $bp, $current_user;
    		wp_get_current_user();
    
    		if($current_user->ID) {
    			if(!in_array($bp->action_variables[1], $this->user_allowed_xprofile_groups)) {
    				$profile_redirect = apply_filters('xpa_plugin_path', 0);
    				error_log($profile_redirect);
    				if($profile_redirect) {
    
    					bp_core_redirect($profile_redirect);
    				} else {
    					bp_core_redirect($bp->displayed_user->domain . BP_XPROFILE_SLUG . '/edit/group/1');
    				}
    			}
    		}
    	}
    Thread Starter Michael

    (@mgparisi)

    FYI, this is for the path to the page we set the redirect too.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Request to add hook for path’ is closed to new replies.