Shape the future of Social networking with WordPress: Join Project Midnight Sun! The next generation platform for community building with WordPress!

BuddyDev

Search

Replies

  • Participant
    Level: Guru
    Posts: 922
    Tosin on in reply to: Code conflict #46388

    Another reminder sir

    Thanks

  • Participant
    Level: Guru
    Posts: 922
    Tosin on in reply to: Code conflict #46314

    kind reminder boss

  • Participant
    Level: Guru
    Posts: 922

    Hi Brajesh

    This code no longer works

    
    /**
     * Assign (Sponsored Post) category to BuddyBlog pay per post articles on checkout.
     */
    add_action( 'bblpro_ppp_post_published', function( $post_id ) {
    	$post_type = get_post_type( $post_id );
    	if ( 'post' != $post_type ) {
    		return;
    	}
    	// Get category.
    	$newcat = get_term_by( 'name', 'Sponsored posts', 'category' );
    	if ( ! $newcat ) {
    		return;
    	}
    	wp_set_post_categories( $post_id, $newcat->term_id, true );
    } );
    
  • Participant
    Level: Guru
    Posts: 922
    Tosin on in reply to: buddyblog medium editor not displaying embeds #46260

    The embeds are working in the single post pages but when the video link is added via the editor the video preview does not show.

    see image below

    https://ibb.co/QD4Rr8w

  • Participant
    Level: Guru
    Posts: 922

    Hello,

    1. @ravisharma thanks for the update I have tested the plugin and everything works perfectly now.

    2. @brajesh your snippet also works smoothly for emptying cart.

    Thanks

  • Participant
    Level: Guru
    Posts: 922
    Tosin on in reply to: Code conflict #46240

    Gentle reminder sir

    Thanks

  • Participant
    Level: Guru
    Posts: 922

    Hi Brajesh

    I had to add the value (true) to get it to work

    WC()->cart->empty_cart( true );

  • Participant
    Level: Guru
    Posts: 922
    Tosin on in reply to: buddyblog medium editor not displaying embeds #46238

    Thanks Brajesh

    The issue with the space is now resolved

  • Participant
    Level: Guru
    Posts: 922
    This reply has been marked as private.
  • Participant
    Level: Guru
    Posts: 922

    Hello Niculae,

    I solved this problem using the code to empty cart on (create-new-post) page load.

    
     /* Empty woocommerce cart on a specific page to avoid conflict with buddyblog pay per post */
    add_action( 'template_redirect', 'woocommerce_clear_post_cart_url' );
    function woocommerce_clear_post_cart_url() {
        global $post;
        $slug = $post->post_name;
        if($slug == 'create-new-post') {
            global $woocommerce;
            $woocommerce->cart->empty_cart();
        }
    } 
    

    @brajesh I’ll like to ask regarding the code above. what effect will the code have when multiple users load the (create-new-post) page. I hope it would not affect site performance, if it will, can the code be refined for better optimisation.

    Maybe adding a condition not to run the code when user cart is empty

    Thanks