WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 8 months ago

Last modified 8 months 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:

Description

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)

comment:1 follow-up: johnbillion3 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() )

comment:2 johnbillion3 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.

comment:3 nacin3 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.

comment:4 johnbillion3 years ago

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

comment:5 johnbillion8 months ago

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

The boat has sailed.

comment:6 in reply to: ↑ 1 SergeyBiryukov8 months 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.