Polylang + wpp_get_mostpopular( $args ) function returns nothing in French
-
Hi,
Not sure if anyone ran into this. Since updating to WPP 6.1.2 when using the wpp_get_mostpopular function and limiting to specific categories using pll_get_term, the alternative language posts will not display. English works fine. I can confirm that nothing is being found for the French page since the wpp_no_data filter is firing. Actually even when I hardcode the category, it shows on English page but not on French page (and I do have the translations for the English posts), so doesn’t appear to be related to the actuall pll_get_term function. Code is below:
$args = array( 'post_type' => 'post', 'limit' => 3, 'cat' => pll_get_term( $cat_ID, 'en' ), 'stats_views' => 0, 'range' => 'all', 'freshness' => 1, 'wpp_start' => '<div id="popularPosts" class="sidebarHelpPages popularPosts" aria-labelledby="helpfulfaqs"> <section class="sidebarHelpTopics"><h2 id="helpfulfaqs">' . $helpfulFaqs . '</h2><ul>', 'wpp_end' => $closerForAside, ); wpp_get_mostpopular( $args );
Rolling back before 6.1.2 fixes the issue. According to changelog, the only thing that stands out beside classic widget removal is:
“now uses the Tax_Query class to filter popular posts by taxonomy, pretty much similar to how WP_Query does it”
Here is some debug info form my localhost although exact same issue happens on my server which has different php version, I’m using Polylang 3.5.2:
Plugin Configuration Performance Nag: Inactive Log Limit: Yes, keep data for 180 days Log Views From: Visitors only Data Caching: No Data Sampling: No External object cache: No WPP_CACHE_VIEWS: No
System Info PHP version: 7.4.28 PHP extensions: Core, bcmath, calendar, ctype, date, filter, hash, iconv, json, SPL, pcre, readline, Reflection, session, standard, mysqlnd, tokenizer, zip, zlib, libxml, dom, PDO, openssl, SimpleXML, xml, xmlreader, xmlwriter, apache2handler, curl, fileinfo, gd, intl, mbstring, exif, mysqli, Phar, pdo_mysql, xsl, xdebug Database version: 5.7.40 InnoDB availability: DEFAULT WordPress version: 6.1.4 Multisite: NoI’m still investigating, but if there is anything that stands out would appreciate the help!
- The topic ‘Polylang + wpp_get_mostpopular( $args ) function returns nothing in French’ is closed to new replies.