WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#28405 closed defect (bug) (fixed)

Twenty Fourteen - hardcoded pagination base

Reported by: pavelevap Owned by:
Milestone: 4.0 Priority: normal
Severity: normal Version: 4.0
Component: Bundled Theme Keywords: has-patch commit
Focuses: Cc:

Description

Twenty Fourteen does not support custom pagination base in twentyfourteen_paging_nav().

I tried following example, but links show "page" (and do not work):

function custom_pagination_base() {
  global $wp_rewrite;
  $wp_rewrite->pagination_base = 'stranka';
}
add_action( 'init', 'custom_pagination_base' );

I know I can change twentyfourteen_paging_nav() in child theme, but some users had problem with it (for example using simle plugin for custom permalinks in localized versions).

Attachments (2)

28405.patch (1.5 KB) - added by SergeyBiryukov 7 years ago.
28405.2.patch (1.7 KB) - added by SergeyBiryukov 7 years ago.

Download all attachments as: .zip

Change History (10)

#1 @SergeyBiryukov
7 years ago

  • Keywords has-patch needs-testing added
  • Milestone changed from Awaiting Review to 4.0

#2 @pavelevap
7 years ago

Thank you, Sergey! Works well. I tried many possibilities and different permalinks and no problem found using your patch!

#3 @SergeyBiryukov
7 years ago

  • Keywords commit added; needs-testing removed

#4 @obenland
7 years ago

Looks good. It would be nice if the globals could be documented in the function documentation on commit. Looks like we didn't do that initially.

#5 @lancewillett
7 years ago

Yes, let's add the documentation before commit, please. Want to refresh the patch?

#6 follow-up: @SergeyBiryukov
7 years ago

28405.2.patch adds documentation for globals.

We should also probably add it for twentyfourteen_wp_title() in another ticket:
tags/3.9.1/src/wp-content/themes/twentyfourteen/functions.php#L460

#7 in reply to: ↑ 6 @lancewillett
7 years ago

Replying to SergeyBiryukov:

28405.2.patch adds documentation for globals.

спасибо.

We should also probably add it for twentyfourteen_wp_title() in another ticket:
tags/3.9.1/src/wp-content/themes/twentyfourteen/functions.php#L460

Added + patch in #28421.

#8 @lancewillett
7 years ago

  • Resolution set to fixed
  • Status changed from new to closed

Hmm, SVN commit didn't auto-close and add a comment here.


In [28645] Twenty Fourteen: change hardcoded pagination base to use the WordPress Rewrite object's pagination_base value instead. Document global variable usage properly.

Props SergeyBiryukov, fixes #28405.

Note: See TracTickets for help on using tickets.