Permalink
Browse files

Deprecate primer_paging_nav. Introduce primer_pagination.

  • Loading branch information...
Evan Herman
Evan Herman committed Feb 27, 2017
1 parent 6ae69b4 commit 5565e104e86e46faa7464de89a96cfb6b48bb979
Showing with 18 additions and 37 deletions.
  1. +1 −1 archive.php
  2. +15 −34 inc/template-tags.php
  3. +1 −1 index.php
  4. +1 −1 search.php
View
@@ -29,7 +29,7 @@
<?php endwhile; ?>
- <?php primer_paging_nav(); ?>
+ <?php primer_pagination(); ?>
<?php else : ?>
View
@@ -113,16 +113,28 @@ function primer_the_page_title() {
}
+/**
+ * Display navigation to next/previous set of posts when applicable.
+ *
+ * @deprecated NEXT No longer supported as the pagination funciton. See primer_pagination().
+ */
+function primer_paging_nav( $args = array() ) {
+
+ return _doing_it_wrong( 'primer_paging_nav()', __( 'Please use primer_pagination() instead.', 'primer' ), 'NEXT' );
+
+}
+
/**
* Display navigation to next/previous set of posts when applicable.
*
* @global WP_Query $wp_query
- * @since 1.0.0
+ * @since NEXT
* @uses [the_posts_pagination](https://developer.wordpress.org/reference/functions/the_posts_pagination/)
*
* @param array $args (optional) Post pagination arguments.
+ *
*/
-function primer_paging_nav( $args = array() ) {
+function primer_pagination( $args = array() ) {
global $wp_query;
@@ -132,37 +144,6 @@ function primer_paging_nav( $args = array() ) {
}
- // Backward compat for older child themes that don't have styles for `the_posts_pagination()` markup.
- if ( primer_child_version_compare( '1.1.0', '<=' ) ) {
-
- ?>
- <nav class="navigation paging-navigation">
-
- <h2 class="screen-reader-text"><?php esc_html_e( 'Posts navigation', 'primer' ); ?></h2>
-
- <div class="nav-links">
-
- <?php if ( get_next_posts_link() ) : ?>
-
- <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'primer' ) ); ?></div>
-
- <?php endif; ?>
-
- <?php if ( get_previous_posts_link() ) : ?>
-
- <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'primer' ) ); ?></div>
-
- <?php endif; ?>
-
- </div><!-- .nav-links -->
-
- </nav><!-- .navigation -->
- <?php
-
- return; // End backward compat.
-
- }
-
global $post;
$post_type_labels = get_post_type_labels( get_post_type_object( $post->post_type ) );
@@ -178,7 +159,7 @@ function primer_paging_nav( $args = array() ) {
*
* @var array
*/
- $defaults = (array) apply_filters( 'primer_paging_nav_default_args', array(
+ $defaults = (array) apply_filters( 'primer_pagination_default_args', array(
'prev_text' => __( '&larr; Previous', 'primer' ),
'next_text' => __( 'Next &rarr;', 'primer' ),
'screen_reader_text' => sprintf( esc_html_x( '%1$s navigation', 'post type singular label', 'primer' ), esc_html( $post_type_label ) ),
View
@@ -27,7 +27,7 @@
<?php endwhile; ?>
- <?php primer_paging_nav(); ?>
+ <?php primer_pagination(); ?>
<?php else : ?>
View
@@ -22,7 +22,7 @@
<?php endwhile; ?>
- <?php primer_paging_nav(); ?>
+ <?php primer_pagination(); ?>
<?php else : ?>

0 comments on commit 5565e10

Please sign in to comment.