[Status] status update goes to blog and not the activity wall

I signed up to get this status plugin and thought it would automatically link to the user activity. It never occurred to me it would be to my blog. Is there a work around for this? Thank you!!

  • Adam Czajczyk

    Hello Jill,

    I hope you're well today and thank you for your question!

    The "Status" plugin is not an "activity status" in that same sense as BuddyPress Activity "wall' or classic "Facebook wall". It's rather a way for a users to quickly post "short posts" (similar to "fb statuses"). Status itself is actually a custom post.

    However, I'm not sure if I understood your goal correctly. Could you explain a bit more what exactly would you want to achieve? I'll then see if we can find a workaround for a "Status" plugin or suggest some other solution.

    Kind regards,
    Adam

  • Predrag Dubajic

    Hi Jill,

    I'm afraid that the plugin can't be easily changed to switch to buddypress activity, however I might have a workaround that should do this.

    We could use one of the post formats for status updates and then remove that post format from query so it's not displayed on posts list.

    In order to do this first thing is to go to Settings > Status panel, scroll down to "Post format" section and for each option select "Chat" as post format, or some other one that you don't use for regular posts.
    What this does is make all your status posts as Chat format and then we can exclude Chat posts from your post query.

    To exclude the posts now you will need to add below code in your child theme functions.php file or as mu-plugin:

    add_action( 'pre_get_posts', function( $wp_query ){
    
        if (  !is_admin() && $wp_query->is_main_query() ) {
            $format_tax_query = array(
                'taxonomy' => 'post_format',
                'field' => 'slug',
                'terms' => 'post-format-chat',
                'operator' => 'NOT IN'
            );
            $tax_query = $wp_query->get( 'tax_query' );
            if ( is_array( $tax_query ) ) {
                $tax_query = $tax_query + $format_tax_query;
            } else {
                $tax_query = array( $format_tax_query );
            }
            $wp_query->set( 'tax_query', $tax_query );
        }
    
    } );

    Note, if you use format different than Chat then change the 'terms' => 'post-format-chat' line and instead of "chat" enter the format you are using.

    This code will now remove the Chat format from the default post list but still keep it in BuddyPress activity and it should get you the desired behavior.

    Hope this helps :slight_smile:

    Best regards,
    Predrag

  • Adam Czajczyk

    Hi Jill!

    If you have chosen a "status" format, you'd need to change this line in Predrag's code from

    'terms' => 'post-format-chat',

    into

    'terms' => 'post-format-status',

    However, I assume you have done that already since those posts (statuses) got hidden from your blog. This would mean that you might need to additionally add that post type into BP activity as well. This can be achieved with another piece of code.

    In that case, we can assume that the real post type name is "status". Therefore try doing this:

    1. Make sure that there's a file named "bp-custom.php" in the /wp-content/plugins/ folder of your site; if not, create an empty one.

    2. Put this code inside the file and save it:

    add_post_type_support( 'status', 'buddypress-activity');

    Note: please make sure that the bp-custom.php file does start with a php opening tag:

    <?php

    In other words, if the file was not there and you have created one, entire code to put inside will be

    <?php
    add_post_type_support( 'status', 'buddypress-activity');

    Once you save the file, try adding some new status and see if it shows up in BP activity stream.

    Kind regards,
    Adam

  • Predrag Dubajic

    Hi Jill,

    Sorry but I'm not sure that I understand your last question, are you referring to Adam's code that or to code that I provided before?

    Adam's code needs to be added in wp-content/plugins/bp-custom.php, if you don't have that file then create one yourself.
    And the code I provided should be added either in your child theme functions.php or as mu-plugin.

    If I'm missing something here please let us know :slight_smile:

    Best regards,
    Predrag

  • Adam Czajczyk

    Hi @jill15594!

    I'm not really sure then why it's not working. What I could do would be to take a look at this entire code and setup myself and try to make it work but I'd need a full access to the site and server in that case. If you want me to do this, please send in:

    Subject: "Attn: Adam Czajczyk"

    - Mark to my attention, the subject line should contain only: ATTN: Adam Czajczyk
    - Do not include anything else in the subject line, doing so may delay our response due to how email filtering works.
    - Link back to this thread
    - login URL and admin account login credentials (may be a temporary admin account) data
    - Include FTP log-in details (hostname, username & password)
    - Include hosting control panel access details (login address, username & password) - cPanel's usually the control panel used for this, but your provider may use something else; I'll need this for accessing your site's database, preferably via phpMyAdmin
    - Include any relevant URLs for your site

    Please use our contact form here https://premium.wpmudev.org/contact/#i-have-a-different-question

    Please note however, that I might respond with a slight delay as I'm not working on weekends (and the message will be delivered directly to me) and I honestly say that while I'll do what I can do help you make it work, I cannot promise you that I'll be able to do this as the plugin wasn't created for this and a 3rd-party plugin(s) might be involved as well. I'll do my best, though :slight_smile:

    Best regards,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.