Skip to content

Allow extra filtering on admin stats screen for categories, tags, custom taxonomy, custom taxonomy tag/category terms. #273

@chriskostelec

Description

@chriskostelec

I was hoping the stat screen at wp-admin/options-general.php?page=wordpress-popular-posts&tab=stats would only log posts that my wpp_get_mostpopular() template tag was tracking. I know you can only show certain post types by clicking the gear, but it would be great if we could filter further by categories, tags, custom taxonomy, and custom taxonomy tags/categories (not sure if they should be separate inputs or all custom taxonomy things in one input).

Mockup idea:

image

Just to make sure I am not doing something wrong, this is what I'm doing:

if ( function_exists('wpp_get_mostpopular') ) {
  $args = array (
    'limit' => 5,
    'range' => 'last30days',
    'order_by' => 'views',
    'post_type' => 'resources',
    'taxonomy' => 'resource-categories',
    'term_id' => '16',
    'stats_views' => false,
    'wpp_start' => '<ol class="most-read-wrapper">',
    'wpp_end' => '</ol>',
    'post_html' => 
    '<li class="most-read">
      <a href="{url}">
        <h3>{text_title}</h3>
        <span class="article-title-sm">{label}</span>
      </a>
    </li>'
  );
  wpp_get_mostpopular( $args );
}

I know there is a wpp_trackable_post_types filter that would cover it if I only needed to filter by post type, but unfortunately that doesn't cover my situation. Maybe it's not so easy, but it would be nice. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions