Filters for “views per day” string
-
Hi Hector,
I was wondering if you could add some filters to your plugin. I would like to show “566 x” instead of “566.28 views per day” in the widget. I have to change couple of lines of code every time you release a new version. It would really help if I could just implement some filter in my theme.
Have a look at lines 699-711 in includes/class-wordpress-popular-posts-output.php. I suggest changing them to the code snippet below. Would that be a problem? Thanks
if ( $this->options['order_by'] == 'avg' ) { $views_text = apply_filters('wpp_views_per_day_average_label', sprintf( _n( '1 view per day', '%s views per day', $pageviews, 'wordpress-popular-posts' ), number_format_i18n( $pageviews, 2 ) ), $pageviews); } else { $views_text = apply_filters('wpp_views_per_day_total_label',sprintf( _n( '1 view', '%s views', $pageviews, 'wordpress-popular-posts' ), number_format_i18n( $pageviews ) ), pageviews); }
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Filters for “views per day” string’ is closed to new replies.