[wp-trac] [WordPress Trac] #49428: Extend get_the_post_pagination() to consider total argument

WordPress Trac noreply at wordpress.org
Wed Jul 31 19:27:03 UTC 2024


#49428: Extend get_the_post_pagination() to consider total argument
---------------------------------------+------------------------------
 Reporter:  luludak                    |       Owner:  luludak
     Type:  enhancement                |      Status:  closed
 Priority:  normal                     |   Milestone:  Awaiting Review
Component:  Posts, Post Types          |     Version:
 Severity:  minor                      |  Resolution:  invalid
 Keywords:  needs-patch needs-testing  |     Focuses:  template
---------------------------------------+------------------------------
Changes (by debarghyabanerjee):

 * status:  assigned => closed
 * resolution:   => invalid


Comment:

 Replying to [ticket:49428 luludak]:

 Hi @luludak,

 I went through the codebase and found that you can pass the total as an
 argument, we don't need to add any checks because of two reasons, if the
 total ain't present as an argument the default value will be assigned due
 to this line of code:
 {{{
 $args = wp_parse_args( $args, $defaults );
 }}}

 And if, the user is passing the value of total as an argument, it would
 get checked and validated through these lines of code:

 {{{
 $total = (int) $args['total'];
 if ( $total < 2 ) {
     return;
 }
 }}}

 Hence, I believe that we can conclude and close this ticket.
 Thanks.

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


More information about the wp-trac mailing list