pop_commented_join

Description

The “pop_commented_join” filter is used modify the JOIN MySQL statement on for the most commented results.

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

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

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

Example

// Apply filter
function modify_pop_commented_join( $join, $instance ) {
global $wpdb;
return $join . " JOIN $wpdb->post p ON p.ID = tr.object_id";
}
add_filter('pop_commented_join', 'modify_pop_commented_join');

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


Comments

Leave a Reply

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