secumbu

Oxygen user has X posts

Jan 31st, 2022 (edited)
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.49 KB | None | 0 0
  1. if( function_exists('oxygen_vsb_register_condition') ) {
  2.     oxygen_vsb_register_condition('User more than X posts', array('options'=>array(), 'custom'=>true), array('==', '!=', '>=', '<=', '>', '<'), 'sec_user_post_count_callback', 'Post');
  3.     function sec_user_post_count_callback($value, $operator) {
  4.         $counted_posts = count_user_posts(get_current_user_id(),'post');
  5.         $value = intval($value);
  6.         global $OxygenConditions;
  7.         return $OxygenConditions->eval_int($counted_posts, $value, $operator);
  8.     }
  9. }
Add Comment
Please, Sign In to add comment