Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if( ! function_exists( 'videotube_filter_post_view' ) ){
- /**
- * Filter default post view
- * @method videotube_filter_post_view
- */
- function videotube_filter_post_view( $count, $post_id ){
- $view = get_post_meta( $post_id, '_post_views', true );
- if( is_array( $view ) && isset( $view['total'] ) && (int)$view['total'] > 0 ){
- $count = (int)$view['total'];
- }
- return $count;
- }
- add_filter( 'mars_get_count_viewed', 'videotube_filter_post_view', 10, 2 );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement