pop_viewed_where

Description

The “pop_viewed_where” filter is used modify the WHERE MySQL statement on for the most viewed results.

A plugin (or theme) can modify statement with the code:

<?php add_filter( 'pop_viewed_where', 'filter_function_name' ); ?>

The hook is located in the popular-widget/_inc/functions.php file.

Example

// Apply filter
function modify_pop_viewed_where( $where, $instance ) {
	return $where . " AND p.ID = 456";
}
add_filter('pop_viewed_where', 'modify_pop_viewed_where');

Note:  $where is a MySQL join statement string, $instance is a widget object.


Leave a Reply

Your email address will not be published. Required fields are marked *