Tagged: Buddyblog Pro Pay Per Post
Hi,
I also have in the functions.php file these codes related to BuddyBlog Pro.
/**
* BuddyBlog Pro woocommerce validation rule Not adding Points to Pending Article.
*/
add_action( ‘woocommerce_order_status_completed’, function () {
add_filter( ‘gamipress_user_deserves_trigger’, ‘__return_true’ );
}, 9 );add_action( ‘wp_ajax_bblpro_submit_post’, function () {
add_filter( ‘gamipress_user_deserves_trigger’, ‘__return_false’ );
}, 9 );/**
* BuddyBlog Pro field validation rule Not adding Points to Pending Article.
*/
add_filter(‘bblpro_validation_errors’, function ($errors, $submitted_data, $post_data) {$status = $post_data[‘post_status’];
if (!empty($submitted_data[‘bbl_post_title’]) && bblpro_custom_get_words_count($submitted_data[‘bbl_post_title’]) > 20) {
$errors->add(‘bbl_post_title’, __(‘Titlul poate să conțină maxim de 20 de cuvinte.’));
}// additional check for publish.
if (‘publish’ === $status && bblpro_custom_get_words_count($submitted_data[‘bbl_post_content’]) > 5000) {
$errors->add(‘bbl_post_content’, __(‘Articolul poate să conțină maxim 5000 de cuvinte.’));
}return $errors;
}, 10, 3);/**
* Counts number of words in a string.
*
* @param string $str string.
*
* @return int
*/
function bblpro_custom_get_words_count($str)
{
$words = preg_split(“/[\n\r\t ]+/”, $str, -1, PREG_SPLIT_NO_EMPTY);return count($words);
}
/**
* End BuddyBlog Pro field validation rule.
*/Cristi
Hi Cristi,
Thank you for reporting the issue.Yes, there were some issue with Pay per Post. we are in the process of releasing it on BuddyDev this weekend and it will have the fix.
Regards
BrajeshHi,
This is a great news.
I am looking forward to this update.
Thank you
CristiHi Cristi,
Thank you.I am sorry to inform that we will be needing couple more days to put the final version. I am hoping it to be available early next week now.
Regards
BrajeshDear Ravi,
Please can you make the code below work for only (sponsored post) submission type the second code with return_false should not affect (free post) submission type
add_action( 'woocommerce_order_status_completed', function () { add_filter( 'gamipress_user_deserves_trigger', '__return_true' ); }, 9 ); add_action( 'wp_ajax_bblpro_submit_post', function () { add_filter( 'gamipress_user_deserves_trigger', '__return_false' ); }, 9 );
Hi,
Do you think that this week will be ready the update?
Thank youHi Niculae,
Yes, we will be making a release this week for sure.@ Tosin,
We are unable tp provide you assistance with any custom code until the plugin is available as public release. Using custom codes at this state has been very limiting as it forces us to not change our API.Regards
BrajeshHello – I am hoping to purchase this plugin. Is it avaialable for download yet? Does this work with BuddyBlog Pro?
The topic ‘ [Resolved] Pay Per Post by selling access with WooCommerce’ is closed to new replies.