Hi
With the latest buddyblog version 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', 'content_type' ); if ( ! $newcat ) { return; } wp_set_post_categories( $post_id, $newcat->term_id, true ); } );
Please note that ‘content_type’ is a custom taxonomy where (Sponsored Posts) category is created
- This topic was modified 2 years, 2 months ago by Brajesh Singh. Reason: topic title updated from 'BuddyBlog Code not working'
Hi Tosin,
If I remember correctly, the code is related to Pay Per Post plugin.
The hook was dropped and we will be adding it back. Please check it next week when the Pay Per Post plugin is officially available(by mid next week).PS:- Please use relevant titles for your support topics. It helps us as well as others. I appreciate your understanding.
Regards
BrajeshHi Tosin,
The plugin is being released this week and we will certainly include the hook back.Regards
BrajeshHi Tosin,
For the time being, Please change the hook tobblpro_ppp_post_purchase_completed
from
bblpro_ppp_post_published
In your code and it should work as expected.
Regards
Brajesh
The topic ‘ [Resolved] Using code to set category on publishing with BuddyBlog Pay Per Post not working’ is closed to new replies.