Advertisement
darrenbachan

Untitled

Jun 3rd, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.48 KB | None | 0 0
  1. /**
  2. 2335     * Display a paginated navigation to next/previous set of posts,
  3. 2336     * when applicable.
  4. 2337     *
  5. 2338     * @since 4.1.0
  6. 2339     *
  7. 2340     * @param array $args Optional. See {@see get_the_posts_pagination()} for available arguments.
  8. 2341     *                    Default empty array.
  9. 2342     */
  10. 2343    function the_posts_pagination( $args = array() ) {
  11. 2344            echo get_the_posts_pagination( $args );
  12. 2345    }
  13. 2346   
  14. 2347    /**
  15. 2348     * Wraps passed links in navigational markup.
  16. 2349     *
  17. 2350     * @since 4.1.0
  18. 2351     * @access private
  19. 2352     *
  20. 2353     * @param string $links              Navigational links.
  21. 2354     * @param string $class              Optional. Custom class for nav element. Default: 'posts-navigation'.
  22. 2355     * @param string $screen_reader_text Optional. Screen reader text for nav element. Default: 'Posts navigation'.
  23. 2356     * @return string Navigation template tag.
  24. 2357     */
  25. 2358    function _navigation_markup( $links, $class = 'posts-navigation', $screen_reader_text = '' ) {
  26. 2359            if ( empty( $screen_reader_text ) ) {
  27. 2360                    $screen_reader_text = __( 'Posts navigation' );
  28. 2361            }
  29. 2362   
  30. 2363            $template = '
  31. 2364            <nav class="navigation %1$s" role="navigation">
  32. 2365                    <h2 class="screen-reader-text">%2$s</h2>
  33. 2366                    <div class="nav-links">%3$s</div>
  34. 2367            </nav>';
  35. 2368   
  36. 2369            return sprintf( $template, sanitize_html_class( $class ), esc_html( $screen_reader_text ), $links );
  37. 2370    }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement