Advertisement
arie_cristianD

override generate rating in module

Nov 2nd, 2023
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.53 KB | None | 0 0
  1. // Override JNews Generate Rating
  2.  
  3. global $pagenow;
  4. if ( 'post.php' === $pagenow || ! is_admin() || ( defined( 'DOING_AJAX' ) && 'DOING_AJAX' ) ) {
  5.     remove_filter( 'jnews_review_generate_rating', 'jnews_review_generate_rating', null );
  6.     add_filter( 'jnews_review_generate_rating', 'custom_review_generate', null, 3 );
  7.  
  8.     if ( ! function_exists( 'custom_review_generate' ) ) {
  9.         function custom_review_generate( $review, $post_id, $class ) {
  10.             // Return your post rating here
  11.             return '<span> your review star </span>';
  12.         }
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement