BuddyDev

Search

Replies

  • Participant
    Level: Guru
    Posts: 887

    Thanks Ravi

    The code worked perfectly

  • Participant
    Level: Guru
    Posts: 887
    Tosin on in reply to: [Resolved] Buddyblog pro and buddypress 12.0.0 beta 1 #51214

    This is now resolved it was a caching issue

    Thanks

  • Participant
    Level: Guru
    Posts: 887
    Tosin on in reply to: [Resolved] Buddyblog pro and buddypress 12.0.0 beta 1 #51198

    Hi Brajesh,

    I have version 1.4.0 but no new update is available, your changelog at https://buddydev.com/plugins/buddyblog-pro/ says 1.4.0 support bp 12.0.0, i have tested it and Blog tab is not displaying in the user navigation menu

  • Participant
    Level: Guru
    Posts: 887
    Tosin on in reply to: Branded login and buddypress 12.0.0 beta 1 #51132
    This reply has been marked as private.
  • Participant
    Level: Guru
    Posts: 887
    Tosin on in reply to: Branded login and buddypress 12.0.0 beta 1 #51115

    Hi Brajesh,

    This is really heart breaking to know that you are deprecating this awesome plugin, Branded Login has been my number one plugin for buddypress simply because I so much dislike the default wordpress login page, all other alternative plugins to customize the default login pages are just terrible and bloated also using security plugins to change the login url from (wp-login.php) to (login) is also terrible,

    There is not an alternative to your plugin, I would really appreciate your guidance on how you designed your login page for buddydev which looks flawless with your theme’s design.

    Thanks

  • Participant
    Level: Guru
    Posts: 887
    Tosin on in reply to: [Resolved] Buddyblog pro and buddypress 12.0.0 beta 1 #51086

    Gentle reminder sir

    BuddyPress 12.0.0 is now available

  • Participant
    Level: Guru
    Posts: 887
    Tosin on in reply to: Branded login and buddypress 12.0.0 beta 1 #51085

    Gentle reminder sir

    BuddyPress 12.0.0 is now available

  • Participant
    Level: Guru
    Posts: 887
    Tosin on in reply to: [Resolved] Attribute post on account deletion in buddypress #50911

    You are awesome Ravi, thanks a lot

  • Participant
    Level: Guru
    Posts: 887
    Tosin on in reply to: [Resolved] Attribute post on account deletion in buddypress #50889

    it might also be advisable to also use this code to disable comments on posts attributed to the non active user

     function disable_comments_on_single_post_by_user() {
        if (is_singular('post')) {
            $post_id = get_queried_object_id(); // Get the current post ID
    
            // Get the post's author ID and comment status
            $post_author_id = get_post_field('post_author', $post_id);
            $comment_status = get_post_field('comment_status', $post_id);
    
            // Check if the post author's ID matches the specified user ID and comments are open
            if ($post_author_id == 466526 && $comment_status === 'open') {
                // Update post's comment status to 'closed'
                wp_update_post(array(
                    'ID'             => $post_id,
                    'comment_status' => 'closed',
                ));
            }
        }
    }
    add_action('template_redirect', 'disable_comments_on_single_post_by_user');
     
  • Participant
    Level: Guru
    Posts: 887
    Tosin on in reply to: [Resolved] Attribute post on account deletion in buddypress #50888

    Hi Brajesh

    I finally got it to work with this code, kindly review

    I really think this would help with buddyblog when multiple authors delete their account, lots of 404 errors would be prevented

    Also note that the ghostwriter account is just a non active account used to preserve useful content from deleted accounts.

     function reassign_posts_on_user_deletion_to_ghostwriter($user_id) {
        // Check if the deleted user is not the target user (466526)
        if ($user_id !== 466526) {
            $args = array(
                'post_type'      => 'post',
                'author'         => $user_id, // Posts authored by the deleted user
                'posts_per_page' => -1,       // Get all posts
                'fields'         => 'ids',    // Retrieve only post IDs
                'post_status'    => 'publish',// Only published posts
            );
            $posts = get_posts($args);
            // Reassign published posts to user with ID 466526
            foreach ($posts as $post_id) {
                $post_status = get_post_status($post_id);
                if ($post_status === 'publish') {
                    wp_update_post(array(
                        'ID'          => $post_id,
                        'post_author' => 466526,
                    ));
                }
            }
        }
    }
    add_action('bp_core_pre_delete_account', 'reassign_posts_on_user_deletion_to_ghostwriter', 10, 1);