Jakobuz (@jakobuz)

Forum Replies Created

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

  • Jakobuz
    Participant

    @jakobuz

    and in case if the plugin Buddypress is not installed, something like this might be useful:

    // redirect if the url contains the word 'user' and if you are not logged-in
    add_action('init', 'profile_redirect');
    function profile_redirect() {
    if(strpos($_SERVER['REQUEST_URI'], 'user') !== false &&  ! is_user_logged_in()) {
    	wp_redirect("https://www.whateversite.com/" . LOGIN_PAGE_NAME);
    	}
    }

    ‘LOGIN_PAGE_NAME’ = whatever page name you use to login.
    Change the word ‘user’ to your needs.


    Jakobuz
    Participant

    @jakobuz

    Maybe you mean the buddypress profile page?
    in that case this piece of code in the functions.php of your theme might help:

    function sh_walled_garden()	{
    	global $bp;
    	if( bp_is_register_page() || bp_is_activation_page() )
    	return;
    	if( ! bp_is_blog_page() && ! is_user_logged_in() )
    	bp_core_redirect( $bp->root_domain .'/'. 'LOGIN_PAGE_NAME' );
    }
    add_action( 'get_header', 'sh_walled_garden' );

    ‘LOGIN_PAGE_NAME’ = whatever page name you use to login


    Jakobuz
    Participant

    @jakobuz

    edit: when a put all the codes for the custom capabilities in a plugin (so I remove it from the functions.php), I am finally able to change the custom capabilties (by changing them in this plugin).
    Probably it’s because a plugin is loaded before the theme is loaded


    Jakobuz
    Participant

    @jakobuz

    this solved the issue for me:
    I blocked out all codes from the custom roles except for this one:

    function add_role_caps_filter( $caps, $role )
    {
        /* Only filter for roles we are interested in! */
        if( $role == 'bbp_professional' )
            $caps = custom_capabilities( $role );
     
        if( $role == 'bbp_member' )
            $caps = custom_capabilities( $role );
     
        return $caps;
    }
    add_filter( 'bbp_get_caps_for_role', 'add_role_caps_filter', 10, 2 );

    and than I was able to assign capabilities to the new roles via the members plugin of Justin Tadlock.

    I’m still wondering why this works for me … but mayby it works for you too … I hope


    Jakobuz
    Participant

    @jakobuz

    Same problem here .. . all plugins except bbpress deactivated didn’t work out, also switching to twenty-twelve/twenty-fifteen didn’t work out …


    Jakobuz
    Participant

    @jakobuz

    I’ve the same strange behavior on the forum I created, for the time being I removed these dates (because it looks very confusing), but it would be better if the date with the last reply was shown.


    Jakobuz
    Participant

    @jakobuz

    Hai Robin, thanks for your answer and I must admit it helped:
    I was too fast in my conclusion it was caused by bbpress, but it was an another (unimportant) plugin that caused the issue.
    I feel relieved, thx 🙂

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