Conversation
supportThis plugin has broken on upgrade to WordPress 6.6.1. In a list of links, only the first link shows up. It works in WP 6.5.5. Here is an example of a shortcode with the buggy behavior: [links category_name="Articles" class="articles" links_per_page="75" links_list_id="articles_id"]
I found the problem. WordPress 6.6.1 changed one test in the core file wp-includes/bookmark.php , line 310, to be stricter: OLD: if ( -1 != $parsed_args['limit'] ) { NEW: if ( -1 !== $parsed_args['limit'] ) { The problem is that Links Shortcode passes in the value "-1" which fails the stricter test against the integer -1 . The result is that the string LIMIT 1 is appended to the SQL query, cutting off the list of bookmarks after one value. I don’t know if this is a WordPress bug or a plugin bug, but here’s a fix. Modify links-shortcode.php function linkssc_shortcode at line 122: OLD: 'limit' => get_option('linkssc_howmany', '-1'), NEW: 'limit' => (int)get_option('linkssc_howmany', '-1'),
THANK YOU! You’ve saved me a lot of time!
@maiden_taiwan : Many thanks for this solution which works perfectly!
I found the problem. WordPress 6.6.1 changed one test in the core file wp-includes/bookmark.php , line 310, to be stricter: OLD: if ( -1 != $parsed_args['limit'] ) { NEW: if ( -1 !== $parsed_args['limit'] ) { The problem is that Links Shortcode passes in the value "-1" which fails the stricter test against the integer -1 . The result is that the string LIMIT 1 is appended to the SQL query, cutting off the list of bookmarks after one value. I don’t know if this is a WordPress bug or a plugin bug, but here’s a fix. Modify links-shortcode.php function linkssc_shortcode at line 122: OLD: 'limit' => get_option('linkssc_howmany', '-1'), NEW: 'limit' => (int)get_option('linkssc_howmany', '-1'),
THANK YOU! You’ve saved me a lot of time!
@maiden_taiwan : Many thanks for this solution which works perfectly!