The “pop_recent_posts_content” filter is used to modify the HTML in the most viewed tab.

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

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

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


// Apply filter
function modifY_pop_recent_posts_content( $output, $instance, $results  ) {
	return $output . '<div>'. __( 'Custom content' ) .'</div>' ; 
add_filter('pop_recent_posts_content', 'modifY_pop_recent_posts_content');

Note:  $output is a HTML string, $instance is an the widget object, $results is an numeric array of post objects.

Leave a Reply

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