Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)
  • @aaronkin

    Participant

    Great! I will pass this info onto the developer and see what they say. I’ll let you know how it goes.

    just for more reference… here is are the Two Support Topics i started with the developer.
    https://wedevs.com/support/topic/registration-form-post-to-bp-activity-new-member/

    Here is the ongoing ticket, Started a New Topic after the Buddypress update prevented it from working again.
    https://wedevs.com/support/topic/buddypress-activity-feed-not-showing-new-members-wpuf-registration-form/

    @aaronkin

    Participant

    Finally have time to reply….

    THANKS!! for taking the time to help me. Very grateful.

    so simple that all that was needed is the brackets [Job].

    @aaronkin

    Participant

    Yes… the post type is registered by another plugin “Wp Job Manager”. I am new at coding so if i find a script and it actually works “i use it” even though there may be a more correct way.

    I also have another plugin “The Events Calendar” that has post type of ‘tribe_events’ and i am trying to do the same thing as the Job post type.

    I also don’t understand the difference between using “text-domain” and “custom-domain” for the bp_activity_admin_filter ?

    I used info from this Topic/Discussion here: https://buddypress.org/support/topic/cant-seem-to-get-bp-2-2s-post-types-activities-working/

    Here is my full code in bp-custom for Jobs and Events post types…

    //The 'WP Job Manager' post type
    add_post_type_support( 'job_listing', 'buddypress-activity' );
    
    function customize_page_tracking_args_job() {
        // Check if the Activity component is active before using it.
        if ( ! bp_is_active( 'activity' ) ) {
            return;
        }
     
        bp_activity_set_post_type_tracking_args( 'job_listing', array(
    			'component_id' => 'activity',
            'action_id'                => 'new_job_listing',
            'bp_activity_admin_filter' => __( 'Published a new Job', 'text-domain' ),
            'bp_activity_front_filter' => __( 'Job', 'text-domain' ),
            'contexts'                 => array( 'activity', 'member' ),
            'activity_comment'         => true,
            'bp_activity_new_post'     => __( '%1$s posted a new Job: <a href="%2$s">Job</a>', 'text-domain' ),
            'bp_activity_new_post_ms'  => __( '%1$s posted a new Job: <a href="%2$s">Job</a>, on the site %3$s', 'text-domain' ),
            'position'                 => 100,
        ) );
    }
    //'The Calednar Events' post type 
    add_action( 'init', 'customize_page_tracking_args_job', 999 );
    
    add_post_type_support( 'tribe_events', 'buddypress-activity' );
    
    function customize_page_tracking_args_event() {
        // Check if the Activity component is active before using it.
        if ( ! bp_is_active( 'activity' ) ) {
            return;
        }
     
        bp_activity_set_post_type_tracking_args( 'tribe_events', array(
    			'component_id' => 'activity',
            'action_id'                => 'new_tribe_events',
            'bp_activity_admin_filter' => __( 'Published a new Event', 'text-domain' ),
            'bp_activity_front_filter' => __( 'Event', 'custom-domain' ),
            'contexts'                 => array( 'activity', 'member' ),
            'activity_comment'         => true,
            'bp_activity_new_post'     => __( '%1$s posted an Event: <a href="%2$s">Event</a>', 'custom-domain' ),
            'bp_activity_new_post_ms'  => __( '%1$s posted an Event: <a href="%2$s">Event</a>, on the site %3$s', 'custom-domain' ),
            'position'                 => 100,
        ) );
    }
    add_action( 'init', 'customize_page_tracking_args_event', 999 );
    

    @aaronkin

    Participant

    @imath thanks for the above code which “adds the post type title into the link in replacement”

    But i need to change one small thing in that code but i dont know how.

    Here is my code in bp-custom.php —

    add_post_type_support( 'job_listing', 'buddypress-activity' );
    function customize_page_tracking_args_job() {
        // Check if the Activity component is active before using it.
        if ( ! bp_is_active( 'activity' ) ) {
            return;
        }
     
        bp_activity_set_post_type_tracking_args( 'job_listing', array(
    			'component_id' => 'activity',
            'action_id'                => 'new_job_listing',
            'bp_activity_admin_filter' => __( 'Published a new Job', 'text-domain' ),
            'bp_activity_front_filter' => __( 'Job', 'text-domain' ),
            'contexts'                 => array( 'activity', 'member' ),
            'activity_comment'         => true,
            'bp_activity_new_post'     => __( '%1$s posted a new Job: <a href="%2$s">Job</a>', 'text-domain' ),
            'bp_activity_new_post_ms'  => __( '%1$s posted a new Job: <a href="%2$s">Job</a>, on the site %3$s', 'text-domain' ),
            'position'                 => 100,
        ) );
    }
    add_action( 'init', 'customize_page_tracking_args_job', 999 );
    

    Here is the result…
    PathPoint-SSB posted a new Job: Job 5 hours, 53 minutes ago

    Here is what it looks like after I use your code to insert the Title of the Job
    pathpoint posted a new Receptionist/Administrative Assistant 5 hours, 49 minutes ago

    As you can see, it changes the Users name and also I cant change this part “posted a new”. I would like it to read “posted a new Job: ”

    Any ideas?

    Thanks for any insight on this,
    Aaron

    @aaronkin

    Participant

    Yes. I have it filter by User Role (wp_capabilities) then sort the list by username. I barely got this working and it took me forever. I would like to also Sort By a xprofile field but i dont know how. I’m sure this code gets me really close but i’m just not experienced enough to figure this out just yet.

    here’s what i have in my functions.php
    This will add 3 drop down items, Organizations, Funders, Company. this sorts by User Role. when people signup for my site they choose the appropriate Reg. Form (each form assigns user role).

    If you ever find out HOW TO SORT BY xProfile Field, please post here.

    add_action( 'bp_members_directory_order_options', 'add_sortby_role' );
    function add_sortby_role() { ?>
    	<option value="sort-organization">Organization</option>
    	<option value="sort-funder">Funder</option>
    	<option value="sort-company">Company</option>
    
    	<?php
    }
    add_action( 'bp_pre_user_query', 'mysortbyorganization' );
    add_action( 'bp_pre_user_query', 'mysortbyfunder' );
    add_action( 'bp_pre_user_query', 'mysortbycompany' );
    
    function mysortbyorganization( $BP_User_Query ) {
    	// Only run this if one of our custom options is selected
    	if ( in_array( $BP_User_Query->query_vars['type'], array( 'sort-organization' ) ) ) {
    		global $wpdb;
    
    		// Adjust SELECT
    		$BP_User_Query->uid_clauses['select'] = "
    SELECT u.ID, u.user_login, u.user_nicename, u.user_email
    FROM $wpdb->users u
    INNER JOIN $wpdb->usermeta m ON m.user_id = u.ID
    WHERE m.meta_key = 'wp_capabilities'
    AND m.meta_value LIKE '%organization%'
    ORDER BY u.user_nicename
    ";
    	}
    }
    function mysortbyfunder( $BP_User_Query ) {
    	// Only run this if one of our custom options is selected
    	if ( in_array( $BP_User_Query->query_vars['type'], array( 'sort-funder' ) ) ) {
    		global $wpdb;
    
    		// Adjust SELECT
    		$BP_User_Query->uid_clauses['select'] = "
    SELECT u.ID, u.user_login, u.user_nicename, u.user_email
    FROM $wpdb->users u
    INNER JOIN $wpdb->usermeta m ON m.user_id = u.ID
    WHERE m.meta_key = 'wp_capabilities'
    AND m.meta_value LIKE '%funder%'
    ORDER BY u.user_nicename
    ";
    	}
    }
    function mysortbycompany( $BP_User_Query ) {
    	// Only run this if one of our custom options is selected
    	if ( in_array( $BP_User_Query->query_vars['type'], array( 'sort-company' ) ) ) {
    		global $wpdb;
    
    		// Adjust SELECT
    		$BP_User_Query->uid_clauses['select'] = "
    SELECT u.ID, u.user_login, u.user_nicename, u.user_email
    FROM $wpdb->users u
    INNER JOIN $wpdb->usermeta m ON m.user_id = u.ID
    WHERE m.meta_key = 'wp_capabilities'
    AND m.meta_value LIKE '%company%'
    ORDER BY u.user_nicename
    ";
    	}
    }
    

    @aaronkin

    Participant

    I used a plugin called WordPress User Frontend Pro and their Buddypress addon. I also used this plugin to create new User Roles “Capability Manager Enhanced”

    @aaronkin

    Participant

    I also would like to know how to make this work.

    @aaronkin

    Participant

    I ALSO want to: “replicate group component to new component with the name ‘organizations'”…and… “i do not want to change group to ‘organizations’ the groups functionality will remain as is but add same functionality copied to new component named ‘organizations’

    I keep seeing @modemlooper @@modemlooper and @shanebp talk/help about this but i still cannot find a solution.

    anyway… just posting a comment to be notified of any further info,

    @aaronkin

    Participant

    bump.

Viewing 9 replies - 1 through 9 (of 9 total)
Skip to toolbar