[oik] plugins.com

WordPress plugins and themes

  • Home
  • About
    • lazy shortcodes
    • smart shortcodes
    • oik base plugin
      • oik – donate
      • oik PayPal buttons
      • oik installation
      • oik Button Shortcode button
      • oik changelog
      • oik FAQ
      • oik plugins on SVN
      • oik plugins on GitHub
  • Plugins
    • oik base plugin
    • FREE oik plugins
    • WordPress plugins
    • Premium oik plugins
    • Bespoke oik plugins
  • Shortcodes
    • Shortcode examples
  • Blocks
    • Block examples
  • APIs
    • ALL action and filter hooks
  • Blog

BW_List_Table::pagination() – Display the pagination.

You appear to be a bot. Output may be restricted

Description

Display the pagination.

Usage

BW_List_Table::pagination( $which );

Parameters

$which
( string ) required –

Returns

void

Source

File name: oik/admin/class-bw-list-table.php
Lines:
1 to 100 of 110
  protected function pagination( $which ) {
    if ( empty( $this->_pagination_args ) ) {
      return;
    }

    $total_items = $this->_pagination_args['total_items'];
    $total_pages = $this->_pagination_args['total_pages'];
    $infinite_scroll = false;
    if ( isset( $this->_pagination_args['infinite_scroll'] ) ) {
      $infinite_scroll = $this->_pagination_args['infinite_scroll'];
    }

    $output = '<span class="displaying-num">' . sprintf( _n( '%s item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '</span>';

    $current = $this->get_pagenum();

    $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );

    $current_url = remove_query_arg( array( 'hotkeys_highlight_last', 'hotkeys_highlight_first' ), $current_url );

    $page_links = array();

    $total_pages_before = '<span class="paging-input">';
    $total_pages_after  = '</span>';

    $disable_first = $disable_last = $disable_prev = $disable_next = false;

     if ( $current == 1 ) {
      $disable_first = true;
      $disable_prev = true;
     }
    if ( $current == 2 ) {
      $disable_first = true;
    }
     if ( $current == $total_pages ) {
      $disable_last = true;
      $disable_next = true;
     }
    if ( $current == $total_pages - 1 ) {
      $disable_last = true;
    }

    if ( $disable_first ) {
      $page_links[] = '<span class="tablenav-pages-navspan" aria-hidden="true">&laquo;</span>';
    } else {
      $page_links[] = sprintf( "<a class='first-page' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
        esc_url( remove_query_arg( 'paged', $current_url ) ),
        __( 'First page' ),
        '&laquo;'
      );
    }

    if ( $disable_prev ) {
      $page_links[] = '<span class="tablenav-pages-navspan" aria-hidden="true">&lsaquo;</span>';
    } else {
      $page_links[] = sprintf( "<a class='prev-page' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
        esc_url( add_query_arg( 'paged', max( 1, $current-1 ), $current_url ) ),
        __( 'Previous page' ),
        '&lsaquo;'
      );
    }

    if ( 'bottom' == $which ) {
      $html_current_page  = $current;
      $total_pages_before = '<span class="screen-reader-text">' . __( 'Current Page' ) . '</span><span id="table-paging" class="paging-input">';
    } else {
      $html_current_page = sprintf( "%s<input class='current-page' id='current-page-selector' type='text' name='paged' value='%s' size='%d' aria-describedby='table-paging' />",
        '<label for="current-page-selector" class="screen-reader-text">' . __( 'Current Page' ) . '</label>',
        $current,
        strlen( $total_pages )
      );
    }
    $html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) );
    $page_links[] = $total_pages_before . sprintf( _x( '%1$s of %2$s', 'paging' ), $html_current_page, $html_total_pages ) . $total_pages_after;

    if ( $disable_next ) {
      $page_links[] = '<span class="tablenav-pages-navspan" aria-hidden="true">&rsaquo;</span>';
    } else {
      $page_links[] = sprintf( "<a class='next-page' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
        esc_url( add_query_arg( 'paged', min( $total_pages, $current+1 ), $current_url ) ),
        __( 'Next page' ),
        '&rsaquo;'
      );
    }

    if ( $disable_last ) {
      $page_links[] = '<span class="tablenav-pages-navspan" aria-hidden="true">&raquo;</span>';
    } else {
      $page_links[] = sprintf( "<a class='last-page' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
        esc_url( add_query_arg( 'paged', $total_pages, $current_url ) ),
        __( 'Last page' ),
        '&raquo;'
      );
    }

    $pagination_links_class = 'pagination-links';
    if ( ! empty( $infinite_scroll ) ) {
      $pagination_links_class = ' hide-if-js';
    }
    $output .= "\n<span class='$pagination_links_class'>" . join( "\n", $page_links ) . '</span>';
 
[1] [2] Next »
 View on GitHub View on Trac

Published: February 2, 2018 | Last updated: February 2, 2018

Information

Function name: BW_List_Table::pagination
Class ref: BW_List_Table
Plugin ref: oik – oik information kit
Version: 4.7.2
Sourcefile: admin/class-bw-list-table.php
File ref: admin/class-bw-list-table.php
Deprecated?: No
API Letters: B,L,P,T

Recent plugin updates

oik v4.7.2 oik v4.7.2 includes a fix to the logic to render blocks for Content and Excerpts in the bw_pages shortcode. ...
oik v4.7.1 Upgrade to oik v4.7.1 for bw_pages rendering blocks for Content and Excerpts, and support for post_name attribute for shortcode which query posts ...
oik-shortcodes v1.41.1 Upgrade to oik-shortcodes v1.41.1 for a couple of minor changes. ...
oik-bob-bing-wide v2.2.2 Upgrade to oik-bob-bing-wide v2.2.2 for improvements to bw_dash examples and fixes to some SVG icon's visibility. ...
oik-bwtrace v3.3.1 Upgrade to oik-bwtrace v3.3.1 to measure plugin load times and ad hoc action timing points. ...

Plugins

  • All Plugins
  • oik base plugin
  • FREE oik plugins
  • WordPress plugins
  • Premium oik plugins

Themes

  • FREE themes
  • Bespoke themes
  • Premium themes

Blocks

  • All Blocks
  • Block examples
  • About Blocks

Shortcodes

  • All Shortcodes
  • Shortcode examples
  • About Shortcodes

Reference

  • About APIs
  • All APIs
  • All Classes
  • All Files
  • All Hooks

Support

  • Contact
  • Cookies policy
  • Get API key
  • Privacy
  • Request support
  • Sitemap
  • Stay informed
  • Terms and Conditions
oik-plugins
Email: [email protected]

Weight shipping plugins

Find out which cart weight shipping plugin you need for your WooCommerce site.
Which cart weight based plugin do I need?

Site:  www.oik-plugins.com
© Copyright oik-plugins 2011-2022. All rights reserved.


Website designed and developed by Herb Miller of Bobbing Wide
Proudly powered by WordPress and oik-plugins
WordPress 6.0.1. PHP: 7.4.30. Memory limit: 768M