Issues with upgrade to 3.2.2
-
Hi Hector,
I have been using your plugin for many years now with a modification required to exclude posts, as follows in the wordpress-popular-posts.php file:
// * authors if ( !empty($instance['author']) ) { $authors = explode(",", $instance['author']); $len = count($authors); if ($len > 1) { // we are getting posts from more that one author $where .= " AND p.post_author IN(".$instance['author'].") "; } else if ($len == 1) { // post from one author only $where .= " AND p.post_author = '".$instance['author']."' "; } } // Excludes ************* $exclude_posts = " p.ID NOT IN (2701,3009,5655,8309,10668,14666,19200,24435,26342,27018,28605,30181,31378,31744,29595,31248,33349,33574,28612,32547,30217,28457,28056,25919,27496,26809,35044,34002,34264,34086,34825,14471,19505,21143, 22571,33959,6558,29875,2331,4196,3528,3009,363,36693,33454,34856,35256,35774,36426,35994,37579,38209,38456,38796,38722,40324,40628,42141,42547,41827,41836,41340,43258,45319,44967,47990,48163,48549,48752,49262,48543,49683,50204,50769,51840,52937,54489,57595,57935) "; $query = "SELECT p.ID AS 'id', p.post_title AS 'title', p.post_date AS 'date', p.post_author AS 'uid' {$fields} FROM {$wpdb->posts} p {$join} WHERE" . $exclude_posts . "AND p.post_status = 'publish' AND p.post_password = '' {$where} GROUP BY p.ID {$having} ORDER BY {$orderby} DESC LIMIT " . $instance['limit'] . ";"; //echo $query; //return $content; $mostpopular = $wpdb->get_results($query);
I want to upgrade to your latest plugin for efficiency and security but still need to have he ability exclude the posts as shown above.
Can you please help as to how I can do this? Is is possible I add a special function in functions.php or add this code in the current version, if so where?
Your help with this is highly appreciated.
Thanks
Indyhttps://www.ads-software.com/plugins/wordpress-popular-posts/
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Issues with upgrade to 3.2.2’ is closed to new replies.