[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
Tue Feb 13 08:25:26 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:  SergeyBiryukov
     Type:  defect (bug)            |      Status:  closed
 Priority:  normal                  |   Milestone:  5.0
Component:  Comments                |     Version:  4.9.4
 Severity:  normal                  |  Resolution:  fixed
 Keywords:  has-patch dev-feedback  |     Focuses:  template
------------------------------------+-----------------------------
Changes (by anantajitjg):

 * keywords:  has-patch => has-patch dev-feedback


Comment:

 Replying to [comment:3 SergeyBiryukov]:
 > In [changeset:"42703"]:
 > {{{
 > #!CommitTicketReference repository="" revision="42703"
 > Comments: Avoid a PHP notice in `paginate_comments_links()` if `type`
 argument is set to array.
 >
 > The function is a wrapper for `paginate_links()`, which returns an array
 if requested.
 >
 > Props anantajitjg.
 > Fixes #43299.
 > }}}
 Hi,
 This is a follow-up to above bug. If I use ''paginate_comments_links()''
 with no options passed it will result in, '''''Notice: Undefined index:
 type in /opt/lampp/htdocs/wordpress/wp-includes/link-template.php on line
 2928''''' when ''WP_DEBUG'' is set to ''true''. That's why I set, 'type'
 => 'plain' in ''defaults'' array. May be a better solution can remove this
 Notice :)

--
Ticket URL: <https://core.trac.wordpress.org/ticket/43299#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list