Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'custom activity page'

Viewing 25 results - 376 through 400 (of 1,252 total)
  • Author
    Search Results
  • #240869
    danbp
    Participant
    #240657
    nkeatign
    Participant

    How can I either write a function, or create a custom template that is only used for the users main profile page?

    The way buddpress works by default, all of the various profile sub-pages seem to use the same exact template.

    For example, I want to specifically target domain.com/username (which we have as the main profile page).

    Do NOT want to target, domain.com/usersname/friends, domain.com/username/followers, domain.com/username/activity etc.

    I need to add some custom data to only the main profile page, and not have it trickle down to the subpages…

    #240512

    In reply to: Sponsored Ads

    danbp
    Participant

    @mecceo,

    you can also read the doc and try to modify the activity template to your need.

    https://codex.buddypress.org/template-updates-2-1/#activity-filter
    and search for similar topics:
    https://buddypress.org/support/search/custom+activity+page/

    Dono12
    Participant

    Yes it is related to “Messages > Starred”. There is nothing wrong with the new feature. It’s this function that I found online that’s causing a conflict.

    /* ——————————Start BP Post in profile code for function——————– */
    function importSomething(){
    return include_once ‘bp-custom.php’;
    }
    add_action( ‘bp_setup_nav’, ‘buddyboss_child_bp_nav_adder’ );
    add_action( ‘bp_template_content’, ‘profile_buddyboss_child_loop’ );
    bp_core_load_template( apply_filters( ‘bp_core_template_plugin’, ‘members/single/plugins’ ) );

    function buddyboss_child_bp_nav_adder() {
    global $bp;
    $post_count = count_user_posts_by_type( $bp->displayed_user->id );
    bp_core_new_nav_item(
    array(
    ‘name’ => sprintf( __( ‘Posts <span>%d</span>’, ‘my-poems’ ), $post_count ),
    ‘slug’ => ‘Articles’,
    ‘position’ => 250,
    ‘show_for_displayed_user’ => true,
    ‘screen_function’ => ‘buddyboss_child_list’,
    ‘item_css_id’ => ‘articles’,
    ‘default_subnav_slug’ => ‘public’
    ));
    }
    function buddyboss_child_list() {
    add_action( ‘bp_template_content’, ‘profile_buddyboss_child_loop’ );
    bp_core_load_template( apply_filters( ‘bp_core_template_plugin’, ‘members/single/plugins’ ) );
    }
    /*——- This is end of the code for above function ———*/
    function profile_buddyboss_child_loop() {
    $myposts = get_posts( array(
    ‘posts_per_page’ => -1,
    ‘author’ => bp_displayed_user_id(),
    ‘post_type’ => ‘post’
    ));
    if( ! empty($myposts) ) {
    foreach($myposts as $post) {
    setup_postdata( $post );
    if (has_post_thumbnail( $post->ID ) ):
    $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), ‘sidebar-smallthumbnew’ );
    else :
    $image[0] = “…/wp-content/themes/Starkers-Child-2/images/vidimage.jpg”;
    endif;
    echo ‘<li class=”sidebar mostpop post-‘ . $post->ID . ‘”><div id=”postimage”>ID) . ‘”></div><div id=”postinfo”>ID) . ‘”>’ . get_the_title($post->ID) . ‘</div>‘;
    }
    echo ‘‘;
    wp_reset_postdata();
    } else { ?>
    <div class=”info” id=”message”>
    <p><?php bp_displayed_user_fullname(); ?> has No posts.</p>
    </div>
    <?php }
    }
    /* This is end of the code for above function */
    remove_filter(‘bp_setup_nav’,”);
    function count_user_posts_by_type( $userid, $post_type = ‘post’ ) {
    global $wpdb;
    $where = get_posts_by_author_sql( $post_type, true, $userid, true);
    $count = $wpdb->get_var( “SELECT COUNT(*) FROM $wpdb->posts $where” );
    return apply_filters( ‘get_usernumposts’, $count, $userid );
    }
    /* ——————————This is end of the code for post in profile above function——————– */

    It adds a new button on the user activity page and when the Message-Starred button is clicked it takes the user the lists of post page that the above function creates. How can I stop that fro happening. I really want to keep the starred message function and I don’t want to lose the lists of WordPress post in the user Activity page.

    Dono12
    Participant

    The New Feature in Buddypress Starred button redirects users to their post page button. I’ve added a button to users buddypress activity page which is titled Post that takes users to a page with a list of their Posts made to WordPress. With the new update when you click on the Starred button the user is redirected to the the list of posts. I created the Post button using this custom function I found Online.

    /* ——————————Start BP Post in profile code for function——————– */
    function importSomething(){
    return include_once ‘bp-custom.php’;
    }
    add_action( ‘bp_setup_nav’, ‘buddyboss_child_bp_nav_adder’ );
    add_action( ‘bp_template_content’, ‘profile_buddyboss_child_loop’ );
    bp_core_load_template( apply_filters( ‘bp_core_template_plugin’, ‘members/single/plugins’ ) );

    function buddyboss_child_bp_nav_adder() {
    global $bp;
    $post_count = count_user_posts_by_type( $bp->displayed_user->id );
    bp_core_new_nav_item(
    array(
    ‘name’ => sprintf( __( ‘Posts <span>%d</span>’, ‘my-poems’ ), $post_count ),
    ‘slug’ => ‘Articles’,
    ‘position’ => 250,
    ‘show_for_displayed_user’ => true,
    ‘screen_function’ => ‘buddyboss_child_list’,
    ‘item_css_id’ => ‘articles’,
    ‘default_subnav_slug’ => ‘public’
    ));
    }
    function buddyboss_child_list() {
    add_action( ‘bp_template_content’, ‘profile_buddyboss_child_loop’ );
    bp_core_load_template( apply_filters( ‘bp_core_template_plugin’, ‘members/single/plugins’ ) );
    }
    /*——- This is end of the code for above function ———*/
    function profile_buddyboss_child_loop() {
    $myposts = get_posts( array(
    ‘posts_per_page’ => -1,
    ‘author’ => bp_displayed_user_id(),
    ‘post_type’ => ‘post’
    ));
    if( ! empty($myposts) ) {
    foreach($myposts as $post) {
    setup_postdata( $post );
    if (has_post_thumbnail( $post->ID ) ):
    $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), ‘sidebar-smallthumbnew’ );
    else :
    $image[0] = “…/wp-content/themes/Starkers-Child-2/images/vidimage.jpg”;
    endif;
    echo ‘<li class=”sidebar mostpop post-‘ . $post->ID . ‘”><div id=”postimage”>ID) . ‘”></div><div id=”postinfo”>ID) . ‘”>’ . get_the_title($post->ID) . ‘</div>‘;
    }
    echo ‘‘;
    wp_reset_postdata();
    } else { ?>
    <div class=”info” id=”message”>
    <p><?php bp_displayed_user_fullname(); ?> has No posts.</p>
    </div>
    <?php }
    }
    /* This is end of the code for above function */
    remove_filter(‘bp_setup_nav’,”);
    function count_user_posts_by_type( $userid, $post_type = ‘post’ ) {
    global $wpdb;
    $where = get_posts_by_author_sql( $post_type, true, $userid, true);
    $count = $wpdb->get_var( “SELECT COUNT(*) FROM $wpdb->posts $where” );
    return apply_filters( ‘get_usernumposts’, $count, $userid );
    }
    /* ——————————This is end of the code for post in profile above function——————– */

    I dont want to get rid of the latest starred button feature, so How can I go about correcting this redirect error.

    Also the new mobile take picture update doesn’t work on the mobile version of my site. I’m using WP-Smart mobile plugin to generate a mobile theme. I also have a copy of Buddypress in both my Child Theme and my active WP smart mobile theme.

    How can I go about fixing these issues if possible.

    Also, great exceptional work on these new updates.

    Thank you

    jay7981
    Participant

    Hello,
    I am quite new to wordpress and buddypress, however i am not new at troubleshooting. I have everything installed per the documentations and ensured its proper working functions with the default 2013 theme un-customized. i then installed a custom plugin to show player stats for an online game. In all themes when going to http://brassmonkeymilitia.net/sitev2/bf3-player-stats/ this page and clicking on details the lightbox pops up behind the theme, however In my troubleshooting i disabled all plugins except this custom one and it worked as it should so i then 1 by 1 enabled plugins and tested the page clearing the cache and reloading the page each time (exhausting as it was….) once i enabled the buddypress plugin it started popping up behind the theme once again. I then went into the settings of buddypress and disabled all components with the exception of the 2 core ones. and tried the page again now it works as it should. so 1 by 1 i enable the components until i get to the activity stream and viola here inlays the problem (yes i disabled the activity stream and continued to test until all other components were enabled.). I would like to have the activity stream working as well as my player stats. what can i do? i do know from some initial searching that having multiple lightbox operators can cause some unwanted issues. does the activity stream utilize a self contained lightbox addon that could be interfering with the themes built in lightbox?

    WP ver:4.2.2
    BP ver:2.2.3.1

    deklein
    Participant

    I am trying to rearrange the buddypress profile menu items with the bp-custom.php file located in WP-Admin > WP-Content > plugins.
    The following code I have is as follows:

    <?php
    // hacks and mods will go here
    
    function mb_profile_menu_tabs(){
    global $bp;
    $bp->bp_nav['media']['position'] = 10;
    $bp->bp_nav['activity']['position'] = 15;
    $bp->bp_nav['forums']['position'] = 15;
    $bp->bp_nav['profile']['position'] = 25;
    $bp->bp_nav['messages']['position'] = 30;
    $bp->bp_nav['notifications']['position'] = 40;
    $bp->bp_nav['friends']['position'] = 50;
    $bp->bp_nav['groups']['position'] = 60;
    $bp->bp_nav['orders']['position'] = 70;
    $bp->bp_nav['profile']['name'] = 'Account';
    $bp->bp_nav['forums']['name'] = 'Collections';
    }
    add_action('bp_setup_nav', 'mb_profile_menu_tabs', 201);
    
    ?>
    

    When I save the file and then refresh my profile page the items are not rearranged or renamed. Am I missing any steps or do i need to copy this document and paste it elsewhere inside other .php files?
    Any suggestions will be helpful! (:

    #239695
    majecdad
    Participant

    First, @henrywright, I think you were right, that code was not creating the entry, it was created because I had add_post_type_support( 'alert', 'buddypress-activity' ); in bp-custom too. Thanks for making me think twice.

    It’s amazing what you can learn in 12 hours. Not enough, but it’s a start. So I tossed the baby out with the bathwater, and read this about 15 times to get to a partial understanding of it. I am now using this:

    // Don't forget to add the 'buddypress-activity' support!
    add_post_type_support( 'alert', '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( 'alert', array(
            /*'component_id'             => buddypress()->blogs->id,*/
            'action_id'                => 'new_alert',
            'bp_activity_admin_filter' => __( 'Published a new alert', 'buddypress' ),
            'bp_activity_front_filter' => __( 'Alerts', 'buddypress' ),
            'contexts'                 => array( 'activity', 'member' ),
            'activity_comment'         => true,
            'bp_activity_new_post'     => __( '%1$s posted an important new <a href="%2$s">** Alert **</a>', 'buddypress' ),
            'bp_activity_new_post_ms'  => __( '%1$s posted a new <a href="%2$s">alert</a>, on the site %3$s', 'buddypress' ),
            'position'                 => 100,
        ) );
    }
    add_action( 'bp_init', 'customize_page_tracking_args' );

    After about 20 different mods, adding and deleting and changing, I got a CPT to take to the activity stream, with the (mostly) modified text I was looking for.

    I actually don’t even know what some of the items in the array are, I just changed things until they worked. 🙂 In fact, I had to comment out component id, because I still haven’t figured out what goes there to keep from getting a WSOD.

    The only main thing I’d really still like to accomplish is getting the Post Title in the link that is created here: '%1$s posted an important new <a href="%2$s">** Alert **</a>' — where it would be like “soandso posted an important new Alert:The Title of the CPT”

    Any ideas out there?

    If this is still not the right/best way to accomplish this, I’m open to suggestion. But I think I am at least stepping in the right direction.

    Thanks.

    #239409

    In reply to: Change "activity" slug

    danbp
    Participant

    3 mounth later….
    just tested the defines and they’re working ! You have a cote error in above code. 😉

    Try this:
    define( 'BP_ACTIVITY_SLUG', 'activitissima' );

    Remind also that BP’s activity page, defined in BP settings, must be empty, without shortcodes, template or page model. Just a title. These pages are dynamic, not static like normal WP pages.
    If you need to modifiy it, use a template override.

    If you still want to understand, please read here:
    https://buddypress.org/support/topic/changing-slugs-with-bp-custom-php-no-change/

    #239405

    In reply to: Change "activity" slug

    milenushka
    Participant

    this one is still uresolved.

    @danbp (https://buddypress.org/support/topic/custom-activity-slug/)
    custom slug change for ACTIVITY does not work for me.

    To change slugs on the sub nav on a member page add these defines to a file bp-custom.php and place this file in /plugins/bp-custom.php

    ?
    1
    2
    define( ‘BP_SETTINGS_SLUG’, ‘settings’ );
    define( ‘BP_XPROFILE_SLUG’, ‘profile’ );

    #239126
    producist
    Participant

    I just tried adding the snippets and again and that problem isn’t happening anymore. However, the filter functionality isn’t working…

    See Screenshot —

    http://postimg.org/image/5ulodg0wz/

    Here’s the code I used….

    <?php
    // hacks and mods will go here ok
    
    // Don't forget to add the 'buddypress-activity' support!
    add_post_type_support( 'page', '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( 'page', array(
            'component_id'             => buddypress()->blogs->id,
            'action_id'                => 'new_blog_page',
            'bp_activity_admin_filter' => __( 'Published a new page', 'custom-domain' ),
            'bp_activity_front_filter' => __( 'Pages', 'custom-domain' ),
            'contexts'                 => array( 'activity', 'member' ),
            'activity_comment'         => true,
            'bp_activity_new_post'     => __( '%1$s posted a new <a href="%2$s">page</a>', 'custom-textdomain' ),
            'bp_activity_new_post_ms'  => __( '%1$s posted a new <a href="%2$s">page</a>, on the site %3$s', 'custom-textdomain' ),
            'position'                 => 100,
        ) );
    }
    add_action( 'bp_init', 'customize_page_tracking_args' );
    
    ?>

    Is there anything I need to add or change in the above code in order to make PAGES show in the filter area?

    #239042
    shanebp
    Moderator

    You can place this in your theme/functions.php or in bp-custom.php.

    It will stop recording entries for 3 types after you include the function.
    You can add other types as desired to the $exclude array.

    function steve_dont_save_activity( $activity_object ) {
     
        $exclude = array( 'new_avatar', 'updated_profile', 'friendship_created' );
     
        if( in_array( $activity_object->type, $exclude ) )
            $activity_object->type = false;
     
    }
    add_action('bp_activity_before_save', 'steve_dont_save_activity', 1, 1 );

    To delete existing entries, use the interface here
    [yoursite]/wp-admin/admin.php?page=bp-activity

    #238987
    producist
    Participant

    I also saw this about multisite installs in the thread you posted:

    “On multisite configurations, the post types that are registered on any sub-site will need to be registered on the root site in order to be listed in the Activity dropdown filters. That’s the case for the post and page post types”

    The site I’m trying to create a custom post type for is a subsite. I assume the Page Post Type is registered for the root install, so this shouldn’t be causing the problem right?

    producist
    Participant

    Hello @imath,

    I was following your thread ( https://codex.buddypress.org/plugindev/post-types-activities/#adding-the-buddypress-support-and-specific-labels-at-post-type-registration) on how to add a custom post type support to the activity stream. I’m currently using WP 4.2.1 and BP 2.2.3.1, with a multisite — directory folder setup.

    I created a custom-bp.php file and uploaded it to my plugins folder and added the code you had for the CPT “pages” on the thread link above. This is the error I got:

    “Parse error: syntax error, unexpected T_FUNCTION in /nas/wp/www/staging/mcs2/wp-content/plugins/bp-custom.php on line 6”

    My goal is to add a custom post type called OFFER to the activity feed using your directions in the thread above. Can you help me with this please?

    Thanks

    morteza13055
    Participant

    Hi to all!
    after update to latest BP, all sidebars (include theme sb, custom sidebar plugin, BP sidebar plugin, widgetize page plugin sidebar) not loading and “BP CHILD PAGES” (not main BP pages) load full-wide!
    my custom theme CSS styles don’t load properly, too!

    Is there any idea for solve these problems?

    ————————————————————————————–
    BP= 2.2.3.1
    WP= 4.1.3

    theme=AVADA(latest)
    plugins=
    1-BP Friends Suggestions Widget
    2-BP Groups Suggest Widget
    3-BP Redirect to Profile for Buddypress
    4-BuddyPics
    5-BuddyPress Activity Privacy
    6-BuddyPress cover
    7-BuddyPress Follow
    8-Buddypress Social
    9-BuddyPress Wall
    10-Buddypress xProfile Rich Text Field
    11-MediaPress

    12-Acunetix WP Security
    13-Sucuri Security

    14-Akismet
    15-Captcha

    16-Login LockDown
    17-Login Widget With Shortcode
    18-Remove Dashboard Access
    19-Rename wp-login.php (unmaintained)

    20-Gravity Forms & its addons

    21-Advanced WP Columns
    22-Fusion Core (on AVADA theme)
    23-LayerSlider WP
    24-Print Friendly and PDF
    25-TinyMCE Advanced
    26-Widgetize pages Light
    27-Ultimate Taxonomy Manager
    28-WordPress SEO (YOAST)

    29-wp-statistics

    30-W3 Total Cache
    31-WP Smush
    32-WP Parallel Loading System
    33-Plugin Organizer

    34-Easy SMTP Mail
    35-SB Welcome Email Editor

    all of these plugins & theme are up to date
    ————————————————————————————
    THANKS a lot!

    #238672
    Kashif Rafique
    Participant

    Is it possible to place a link at the end of the menu on User Profile page? Currently these are present as menu items:

    Activity, Profile, Notifications, Forums, Settings

    I want to place a link to (All Members page) after the Setting menu item.

    I used following code snippet in my functions.php file:

    function lh_custom_setup_nav() {
    	global $bp;
    	bp_core_new_nav_item ( array (
    		'name'				=> __( 'All Members', 'buddypress' ),
    		'slug'				=> 'members',
    		'position'			=> 150,
    		'screen_function'	=> 'bp_members_screen_index',
    	) );
    }
    add_action( 'bp_setup_nav', 'lh_custom_setup_nav' );
    

    It generates this link /members/USERNAME/members/, whereas I need a link to /members/ page.

    leanneoleary
    Participant

    Hi,

    I am trying to customise my admin bar. I have achieved most of what I need to do but am stuck on a couple of things.

    1. I want to remove most of the links from the dropdown menu that appears when you moveover, “How are you, Name?”. I want to keep the top part with the profile link and image but want to remove all the links below that. ie. Activity, Profile, Notifications, Messages.

    2. I want to use a font icon for the Home link but this doesn’t appear, random characters appear instead. Does anyone know why? My code is below:

    //add home page link in top left adminbar - want to use font icon but its not working.
    add_action('admin_bar_menu', 'add_toolbar_items', 100); 
    
    function add_toolbar_items($admin_bar){     
        $admin_bar->add_menu( array(         
            'id'    => 'home',         
            'title' => '<i class="fa fa-home"></i>',         
            'href'  => '/',         
            'meta'  => array(             
                'title' => __('Home'),                     
                ),     
            ));     
    
     } 
    //trying to remove Activity, Profile, Notifications, Messages etc links but doesn't do anythingW
    remove_action( 'bp_adminbar_menus', 'bp_adminbar_blogs_menu', 6 );
    remove_action( 'bp_adminbar_menus', 'bp_adminbar_notifications_menu', 8 );
    #238324
    danbp
    Participant

    Previous snippet changed all avatars (user, blogs and groups) which is not what you want. Here’s a snippet which works almost correctly, but not to 100%. Give it a try anyway.

    It changes the user avatar depending of an xprofile value.

    (add to bp-custom.php)

    function bpfr_my_new_avatar_url() {
    global $bp;
    
    	if( bp_is_user() && ! bp_get_member_user_id() ) {
            $user_id = bp_displayed_user_id();
        } else {
            $user_id = bp_get_member_user_id();
        }
    
    	if ( is_page( 'activity' ) ) {
    		$user_id = bp_get_activity_user_id();	
    	}
    
    $ranking = xprofile_get_field_data ('ranking', $user_id );
    
    	if ($ranking == "Top 25") {		
    		$url = get_stylesheet_directory_uri() .'/custom_img/25.png';
    	}
    	
    	if ($ranking == "Top 24") {		
    		$url = get_stylesheet_directory_uri() .'/custom_img/24.png';
    	}
    return $url;
    
    }
    add_filter( 'bp_core_default_avatar_user', 'bpfr_my_new_avatar_url' );
    

    Create a profile field called “ranking” with 2 options (top 24 & top 25).
    Create a folder in your child-theme called “custom_img” and add 2 pictures: 24.png & 25.png (250×250)
    If everybody must those avatars, disallow avatar upload in BP settings.
    Site default avatar stays as Mystery Man (wp default setting).

    You have also to get rid of Gravatar, so you must add this to bp-custom.php
    add_filter('bp_core_fetch_avatar_no_grav', '__return_true');

    The thing who doesn’t work is related to X & Y are now friends. Both willhave the same avatar.

    Can probably by better improved.

    #238003
    @mcuk
    Participant

    Hi everyone,

    Where are loops such as the Standard Loop in the link below put?

    Activity Loop


    https://codex.wordpress.org/The_Loop_in_Action

    Do they go in the bp-custom.php file? How are they called into use on a new page?

    Any help/guidance of where to look would be appreciated.

    #237964

    In reply to: activity

    danbp
    Participant

    Hi,

    to show only notices (aka updates) on the SWA, try this snippet (place in bp-custom.php)

    function make_swa_show_notice_only( $retval ) {	
    	
    	if ( bp_is_page( 'activity' ) ) {
    	$retval['action'] = 'activity_update';					
    	}
    	
    	return $retval;
    	
    	}
    add_filter( 'bp_after_has_activities_parse_args', 'make_swa_show_notice_only' );

    Reference: https://codex.buddypress.org/developer/using-bp_parse_args-to-filter-buddypress-template-loops/

    @mcuk
    Participant

    Hi all,

    I’m trying to move the Favorites subnav tab and associated page so it appears instead underneath the Notifications nav tab. I don’t want to change what appears on the page by default, purely just move its location. I’m familiar with creating/removing new nav/subnav tabs but am unable to find the correct function to make the page appear as it does by default when its under the Activity nav tab.

    (I also want to do the same with the Mentions subnav tab/page).

    I’ve looked around for a good long while in the forums and the Buddypress files but am not making any headway apart from what I’ve pasted below. Am I calling the correct screen function & link?

    Code I have in my bp_custom.php is:

    <?php
    // Add a new subnav menu tab for Fave under Notifications tab
    function fave_subnav_tab() {
    global $bp;
    $parent_slug = ‘notifications’;

    //Add subnav item
    bp_core_new_subnav_item( array(
    ‘name’ => __( ‘Fave’ ),
    ‘slug’ => fave,
    ‘parent_url’ => $bp->loggedin_user->domain . $parent_slug.’/’,
    ‘parent_slug’ => $parent_slug,
    ‘screen_function’ => ‘bp_activity_screen_favorites’,
    ‘position’ => 30,
    ‘link’ => bp_activity_screen_favorites(),

    ) );
    }

    add_action( ‘bp_setup_nav’, ‘fave_subnav_tab’ );
    ?>

    WP Version: 4.1.1
    BP Version 2.2.2.1

    Thank you for any assistance!

    #237873
    shanebp
    Moderator

    You want to add a ‘Personal’ option to the ‘Show’ selector on Site Wide Activity?

    Try this in your theme/functions.php or in bp-custom.php

    function leanne_activity_filter_options() {
        if ( is_user_logged_in() )
             echo '<option value="personal">Personal</option>';
    }
    add_action( 'bp_activity_filter_options', 'leanne_activity_filter_options' );
    
    function leanne_ajax_querystring( $query_string, $object ) {
    
    	if ( 'activity' != $object ) 
    		return $query_string;
    
    	if ( ! bp_is_activity_directory() ) 
    		return $query_string;
    
    	$query_args = wp_parse_args( $query_string, array() );
    
     	$page = $query_args['page'];
    
    	if( isset( $query_args['action'] ) && $query_args['action'] == 'personal' ) {
    	
    		$query_args = array();
    		$query_args['page'] = $page;
    		$query_args['user_id'] = bp_loggedin_user_id();
    		$query_string = http_build_query( $query_args );
    
    	}
    	
    	return $query_string;
    
    }
    add_filter( 'bp_ajax_querystring', 'leanne_ajax_querystring', 20, 2 );
    Garydock
    Participant

    I’m not sure if this is valuable information. I’ve used firebug to try and locate a file where I can remove this or something and this is all I can see but I don’t know if its related. I just want to remove this warning whatever way possible, everything else seems to all be working ok. activity bp-user my-activity my-account just-me buddypress page page-id-0 page-parent page-template-default logged-in custom-background js woocommerce.

    #237701
    aaronkine
    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 );
    
    #237624
    aaronkine
    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

Viewing 25 results - 376 through 400 (of 1,252 total)
Skip to toolbar