[wp-trac] [WordPress Trac] #43299: function paginate_comments_links() results in a Notice instead of returning an array when 'type' is set to 'array'
WordPress Trac
noreply at wordpress.org
Mon Feb 12 20:03:22 UTC 2018
#43299: function paginate_comments_links() results in a Notice instead of returning
an array when 'type' is set to 'array'
--------------------------+-----------------------------
Reporter: anantajitjg | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Comments | Version: 4.9.4
Severity: normal | Keywords:
Focuses: template |
--------------------------+-----------------------------
function ''paginate_comments_links()'' produced a Notice ( '''''Array to
string conversion in /opt/lampp/htdocs/wordpress/wp-includes/link-
template.php on line 2796''''' ) instead of returning an array when 'type'
is set to 'array'. This function does return an array if 'echo' is set to
false, which is pretty confusing ( user needs to pass an additional option
of 'echo' => false when it is clear that user needs an array ) when used
with 'type' => 'array'!!
'''Expected'''
paginate_comments_links() when 'type' is set to 'array' must return an
array.
'''Actual'''
Instead of returning an array, a ''Notice'' is produced.
'''Steps to reproduce'''
call the function as described below,
{{{#!php
<?php
$links = paginate_comments_links( array(
'type' => 'array'
) );
}}}
'''''Note:''''' WP_DEBUG is set to true
--
Ticket URL: <https://core.trac.wordpress.org/ticket/43299>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list