Collect views in post meta keys
-
Hello.
I noticed your plugin collect views by total, year, month, week and day in the database, so I need to get views by of all that time ranges. I tried to find the right line to get the views data but I failed.
This is a Worpress Popular Posts code which I need help to modify in order to get your views right, or a similar function, please!!!
/* Storing views of different time periods as meta keys */ add_action( 'wpp_post_update_views', 'custom_wpp_update_postviews' ); function custom_wpp_update_postviews($postid) { if ( function_exists('wpp_get_views') ) { update_post_meta( $postid, 'views_total', wpp_get_views( $postid, 'all', false ) ); update_post_meta( $postid, 'views_daily', wpp_get_views( $postid, 'daily' ) ); update_post_meta( $postid, 'views_weekly', wpp_get_views( $postid, 'weekly' ) ); update_post_meta( $postid, 'views_monthly', wpp_get_views( $postid, 'monthly ) ); } }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Collect views in post meta keys’ is closed to new replies.