BuddyDev

Search

[Resolved] Need to delete a textline in BuddyBlog plugin

  • Participant
    Level: Master
    Posts: 497
    Daniel on #20610

    Hi Brajesh,

    I use Buddyblog only for editing, for creating blogs I use the said other plugin.

    The other plugin has more customization in Dashboard that I need in order to moderate the posts before they get published, that’s why I am using it. But with that plugin the user cannot edit the post after publishing, therefore I use Buddyblog to edit the blogs and it works perfectly this way.

    The solution will be then, when the user clicks on ” You haven’t posted anything yet -> “Create New Post” that he will be redirected to the page https://www.mywebsite/create-new-blog that I use to create a new blog.

    I hope I could answer your concerns.

    Thank you.

    Regards
    Daniel

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #20611

    Hi Daniel,
    Please use the following code

    
    
    /**
     * Redirect from new post creation screen.
     */
    function buddyblog_new_post_redirect() {
    	if ( ! is_user_logged_in() || ! bp_is_current_component( 'buddyblog' ) ) {
    		return;
    	}
    
    	if ( bp_is_current_action( 'edit' ) && ! bp_action_variable( 0 ) ) {
    		$redirect_url = site_url( '/create-new-blog/' );
    		bp_core_redirect( $redirect_url );
    	}
    }
    
    add_action( 'bp_template_redirect', 'buddyblog_new_post_redirect' );
    

    That will work.

    Regards
    Brajesh

  • Participant
    Level: Master
    Posts: 497
    Daniel on #20613

    Hi Brajesh,

    The Code is working flawlessly!

    Thank you very much indeed!

    Regards
    Daniel

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #20614

    You are welcome 🙂

    Regards
    Brajesh

The topic ‘ [Resolved] Need to delete a textline in BuddyBlog plugin’ is closed to new replies.

This topic is: resolved