Make WordPress Core

Opened 11 years ago

Closed 8 years ago

Last modified 8 years ago

#15516 closed enhancement (wontfix)

Candidates for new template functions based on code in Twenty Ten

Reported by: johnbillion Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.1
Component: Template Keywords: needs-patch
Focuses: Cc:


There are several pieces of code in Twenty Ten which are candidates for abstraction into template functions. I'll make a list shortly and put it up here to get feedback.

Change History (6)

#1 follow-up: @johnbillion
11 years ago

  • Version set to 3.1

First up in comments.php we have:

if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) )

This is used twice and would be ideal as a function named comments_paged() instead, giving us:

if ( comments_paged() )

#2 @johnbillion
11 years ago

In loop.php we have:

if ( $wp_query->max_num_pages > 1 )

It's not nice using the $wp_query object directly so let's put it in a function. posts_paged() would keep it consistent with comments_paged() suggested above.

if ( posts_paged() )

Much nicer.

#3 @nacin
11 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release

Been thinking about a replacement for max_mum_pages for a while. Unfortunately, we use 'paged' in the context of page > 2, not total pages > 2. Would be interested to make new functions though.

#4 @johnbillion
11 years ago

Maybe use the term 'paginated' instead of 'paged' then? Giving us comments_paginated() and posts_paginated(). Might need thinking about.

#5 @johnbillion
8 years ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed

The boat has sailed.

#6 in reply to: ↑ 1 @SergeyBiryukov
8 years ago

Replying to johnbillion:

First up in comments.php we have:

if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) )

Related: #17778

Note: See TracTickets for help on using tickets.