Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 25 replies - 1 through 25 (of 227 total)
  • Profile photo of imath
    imath
    Moderator

    @imath

    Hi @svenl77,

    It’s the case, just tested it and the function does what it intends to do : remove the group-avatar && the delete-group manage tabs.

    I don’t manage to reproduce your issue. If i go to groups/GROUP-SLUG/adminthen i’m automatically redirected to groups/GROUP-SLUG/admin/edit-details so no 404.

    My config is :
    fresh install
    WordPress latest trunk
    BuddyPress latest trunk
    twentytwelve

    I don’t think we’ve played in this area since 2.2.1

    FYI : if i add the edit-details to the list of restricted tabs, then the group admin cannot access to any manage page without knowing the url of the allowed tabs. So i’d say the edit-details should always be there.

    Profile photo of imath
    imath
    Moderator

    @imath

    Hi @aglekis

    I can imagine why setting the Members directory page as a Parent of the groups directory page is not working: the built url must Be in this case site.url/members/groups and then BuddyPress is looking for a member having the username “groups” and do not find it :)

    Instead of using the Parent attribute, you can use wp_nav_menus ;)

    Profile photo of imath
    imath
    Moderator

    @imath

    Hi Grégoire,

    Thanks for the ping :) To make sure i understand well :
    When the directory page for the group is a child of another page then you get a 404, is that correct ?

    Profile photo of imath
    imath
    Moderator

    @imath

    Very strange.

    Have you tried to deactivate all plugins except BuddyPress to see if that wasn’t a problem with another plugin ?

    Have you tried to activate a WordPress default theme to see if it wasn’t a problem with the active theme ?

    Do you have custom function in bp-custom.php, if so try to remove them temporarly.

    If all of the above is not changing anything to your trouble, if you deactivate BuddyPress is the problem still there (you can actually begin by this step, if you prefer) ?

    Profile photo of imath
    imath
    Moderator

    @imath

    @alice-claire

    I don’t think it’s the same issue as you’re getting the register page even if signups are not allowed. So i advise you to remove the code of the gist if you are using it.

    If i understand well, your issue is when you save the general settings having the “anyone can register” option checked, this option is not saved and you keep having the message “User Registration is Currently Not Allowed” when a user tries to register. Is that correct ?

    Profile photo of imath
    imath
    Moderator

    @imath

    Adding a trailing slash is fixing the issue : http://kompanio.de/register/

    Profile photo of imath
    imath
    Moderator

    @imath

    Thanks a lot @gina yes we need to test this fix on 2.2.0 so you’ll need to backup your database (and wp-content files just in case) and upgrade again. Once done paste the script in a bp-custom.php file you will put in your plugins directory. The test patch will only be run If BuddyPress 2.2 is activated. If it’s fixing the issue with invite anyone you can choose to keep it till 2.2.1 is released or If you are afraid to Forget to remove it by then, revert once again to 2.1.1.

    Profile photo of imath
    imath
    Moderator

    @imath

    @gina

    As i told you we’ve been working on a patch and i would like to have your feedback on what we’re planning to do to be sure it’s the right fix to your problem.

    Simply put the content of this gist https://gist.github.com/imath/07e79c2244c5ab2e0a1b in a file you will name bp-custom.php and that you will put at the root of your plugins directory.

    Thanks a lot for your help.

    Profile photo of imath
    imath
    Moderator

    @imath

    @r-a-y is right, pages will come back as soon as signups are allowed.

    But if you are using a plugin like invite anyone, you might need to set these pages. We’re currently working on a patch and if you are in this case please consider testing/giving your feedback about this script https://gist.github.com/imath/07e79c2244c5ab2e0a1b (simply add it in a bp-custom.php file at the root of your plugins directory)

    Profile photo of imath
    imath
    Moderator

    @imath

    @gatelli

    So the question is ‘How can i edit the action string eg: someone wrote a new event, if the event was posted having a race tag or a training session tag ?’

    is this correct ?

    If so, you’ll need to filter ‘bp_activity_custom_post_type_post_action’, get the secondary item id which is the post type id, fetch the tag for this post type id and override the action string.

    Profile photo of imath
    imath
    Moderator

    @imath

    @rossagrant you’re very welcome :)

    Profile photo of imath
    imath
    Moderator

    @imath

    If you define a contexts argument in the bp_activity post type parameter, it allows you to controle the front dropdown filters where the option will be output : see https://codex.buddypress.org/developer/function-examples/bp_activity_set_action/ for a full explanation.

    If this is still not working, i can see 2 explanations :
    1/ The active theme is a standalone BuddyPress theme or a theme that overrides some templates without being ready for the way of fetching activity filters introduced in BuddyPress 2.1 see : https://codex.buddypress.org/themes/activity-dropdown-filters-in-templates/
    2/ Or the post type is registered within a subsite scope and not registered network widely.

    Profile photo of imath
    imath
    Moderator

    @imath

    Hi i only see labels argument of your custom post type in your description how do you actually add the ‘buddpress-activity’ support and do you use a bp_activity argument where you define the contexts for the front end dropdown filters.

    https://codex.buddypress.org/plugindev/post-types-activities/#adding-the-buddypress-support-and-specific-labels-at-post-type-registration

    Profile photo of imath
    imath
    Moderator

    @imath

    Thanks for your help, it’s what i’m working on as in this case in version 2.1.1 we had this screen shown :

    https://cldup.com/JJiIskSjTR.png

    Profile photo of imath
    imath
    Moderator

    @imath

    @disha76

    having this settings on “Logged in users may register new sites” means registrations are off for WordPress. Deactivate BuddyPress and you will see WordPress will not allow you to register. Activate BuddyPress 2.1.1 and you’ll see that there are no regressions.

    The problem is elsewhere.

    Profile photo of imath
    imath
    Moderator

    @imath

    @gina i’m not so sure about invite anyone i think there might Be a problem with BuddyPress. I need some time to Fully understand

    Profile photo of imath
    imath
    Moderator

    @imath

    In BuddyPress 2.1.1, when using this setting “Logged in users may register new sites” > registering new users is not available.
    If you deactivate BuddyPress to only let WordPress, this setting doesn’t generate a registration link.
    In BuddyPress 2.2 same behavior. So no bug.

    This means the problem is coming from the plugin invite anyone. Since BuddyPress 2.2, the way this plugin was overriding BuddyPress site options is not working anymore. I’m going to inform the developer of the plugin.

    Profile photo of imath
    imath
    Moderator

    @imath

    @gina i’ve managed to reproduce. It looks like activating this option : “Logged in users may register new sites” is problematic. Working on it. I’ll keep this thread updated with my progress.

    Profile photo of imath
    imath
    Moderator

    @imath

    @gina have you tested by de activating invite anyone plugin ?

    Profile photo of imath
    imath
    Moderator

    @imath

    Hi @betro99

    Sorry you have this issue after upgrading. If you go in Settings > BuddyPress > Page are the registration and activate page set ? If you go in Settings > General > Anyone can register is activated ?

    Profile photo of imath
    imath
    Moderator

    @imath

    Hi @espyd,

    Sorry you are having this issue after upgrading. Just to help us understand why it’s happening, could you reply to these questions:

    WordPress version ?
    WordPress configuation ? (Multisite or not)
    If multisite: is BuddyPress activated on the main site or in a sub site ?
    In the General settings of WordPress is the registration setting on ?
    Are you using a cache plugin ?

    Profile photo of imath
    imath
    Moderator

    @imath

    @monkey1980, this is the missing step.

    Here’s how you can add the post type title into the link in replacement of ‘Artikel’

    function monkey1980_include_post_type_title( $action, $activity ) {
    	if ( empty( $activity->id ) ) {
    		return $action;
    	}
    
    	if ( 'new_sd_article' != $activity->type ) {
    		return $action;
    	}
    
    	preg_match_all( '/<a.*?>([^>]*)<\/a>/', $activity->action, $matches );
    
    	if ( empty( $matches[1][1] ) || 'Artikel' != $matches[1][1] ) {
    		return $action;
    	}
    
    	$post_type_title = bp_activity_get_meta( $activity->id, 'post_title' );
    
    	if ( empty( $post_type_title ) ) {
    		switch_to_blog( $activity->item_id );
    
    		$post_type_title = get_post_field( 'post_title', $activity->secondary_item_id );
    
    		// We have a title save it in activity meta to avoid switching blogs too much
    		if ( ! empty( $post_type_title ) ) {
    			bp_activity_update_meta( $activity->id, 'post_title', $post_type_title );
    		}
    
    		restore_current_blog();
    	}
    
    	return str_replace( $matches[1][1], esc_html( $post_type_title ), $activity->action );
    }
    add_filter( 'bp_activity_custom_post_type_post_action', 'monkey1980_include_post_type_title', 10, 2 );
    Profile photo of imath
    imath
    Moderator

    @imath

    Interesting discussion :)

    First i’ll explain why i’m using bp_is_active( 'activity' ) : it’s just an extra check to be absolutely sure the activity component is active. I do it because BuddyPress is a set of components you can activate / deactivate from the BuddyPress settings. So if the activity component is not active, no need to add Post Type activities. And when you develop a BuddyPress plugin, you need to remember there can be configs that deactivated the component you are extending.

    Second, about the contexts argument. In this codex page https://codex.buddypress.org/plugindev/post-types-activities/ i’m describing a bit his role
    Here https://codex.buddypress.org/themes/activity-dropdown-filters-in-templates/ i’m talking about the way we are getting the activity types since BuddyPress 2.1 And finally reading this page https://codex.buddypress.org/developer/function-examples/bp_activity_set_action/ you will see the interest of the contexts argument.
    In short the contexts argument is a way to control where you want an option (activity action) to be displayed. For instance if you want to include an option into the single group’s home page dropdown filter you do contexts => array( 'group' )

    In the case of a post type, i think in most cases there’s not a great interest to have the activity filter in the group’s single home page because in most cases the post type have been created out of a BuddyPress group (mainly in WP Admin actually). That’s why in my example i suggest to use 'contexts' => array( 'activity', 'member' ), ‘activity’ means display the dropdown option into the activity directory and ‘member’ display it into the member’s profile. The ‘member’ context is interesting in the case of Post Types activities because a post type is always created by a user_id.

    Now with the question “could it be possible to display Post type activities into a given group’s stream ?” we must understand this part 'component_id' => 'activity' Here you are defining the component you want the Post type activities to be linked to. So you could say cool! lets put ‘groups’ to have activities in groups. But here you’d be wrong because all generated activities would be displayed in the first group the one having the id #1 (If multisite it could give another illusion…) Why id #1, because it’s the id of the blog where was created the post type. So you would need to have a different value depending from which group the post type was posted. As in core we don’t include a feature to post a post type from a group, by default we are setting the item_id field to the current blog.

    Unless you want to arbitrary display the activity in one particular group, i’d say this need should only concern Plugins extending the Groups component. Of course it’s possible, and i’ve done it for one of my plugin.

    I hope my explanations will help you @youmin.

    Profile photo of imath
    imath
    Moderator

    @imath

    This can be done using a specific filter. I’ll look at it soon. Glad the first step is achieved :)

    Profile photo of imath
    imath
    Moderator

    @imath

    At What priority does Easy Custom Post Types hooks ‘init’ ?

    You need to be sure the post type has been defined before using bp_activity_set_post_type_tracking_args() so change ‘bp_init’ to ‘init’ and try to add a very late priority, eg:

    // Don't forget to add the 'buddypress-activity' support!
    add_post_type_support( 'sd_article', 'buddypress-activity' );
     
    function customize_page_tracking_args() {
        // Check if the Activity component is active before using it.
        if ( ! bp_is_active( 'activity' ) ) {
            return;
        }
     
        bp_activity_set_post_type_tracking_args( 'sd_article', array(
            'component_id'             => 'activity',
            'action_id'                => 'new_sd_article',
            'bp_activity_admin_filter' => __( 'Neuer Artikel veröffentlicht', 'custom-domain' ),
            'bp_activity_front_filter' => __( 'Artikel', 'custom-domain' ),
            'contexts'                 => array( 'activity', 'member' ),
            'bp_activity_new_post'     => __( '%1$s hat den neuen <a href="%2$s">Artikel</a>', 'sozialdynamik' ),
            'bp_activity_new_post_ms'  => __( '%1$s hat den neuen <a href="%2$s">Artikel</a>, on the site %3$s', 'sozialdynamik' ),
            'position'                 => 100,
        ) );
    }
    add_action( 'init', 'customize_page_tracking_args', 1000 );
Viewing 25 replies - 1 through 25 (of 227 total)