Replies
- Tosin on August 31, 2022 at 10:00 am in reply to: [Resolved] Pay Per Post by selling access with WooCommerce #46263
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 ); } ); - Tosin on August 30, 2022 at 9:36 pm 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
- Tosin on August 30, 2022 at 7:33 pm in reply to: [Resolved] Pay Per Post by selling access with WooCommerce #46259
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
- Tosin on August 30, 2022 at 10:15 am in reply to: [Resolved] Pay Per Post by selling access with WooCommerce #46239
Hi Brajesh
I had to add the value (true) to get it to work
WC()->cart->empty_cart( true ); - Tosin on August 30, 2022 at 9:49 am in reply to: buddyblog medium editor not displaying embeds #46238
Thanks Brajesh
The issue with the space is now resolved
- Tosin on August 30, 2022 at 7:28 am in reply to: [Resolved] Pay Per Post by selling access with WooCommerce #46231This reply has been marked as private.
- Tosin on August 30, 2022 at 7:19 am in reply to: [Resolved] Pay Per Post by selling access with WooCommerce #46230
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