WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/05/2010 03:15:46 PM (9 years ago)
Author:
scribu
Message:

Introduce WP_List_Table::get_items_per_page(). See #14579

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/list-table.php

    r15535 r15569  
    324324   
    325325        return max( 1, $pagenum );
     326    }
     327
     328    /**
     329     * Get number of items to display on a single page
     330     *
     331     * @since 3.1.0
     332     * @access protected
     333     *
     334     * @return int
     335     */
     336    function get_items_per_page( $option, $default = 20 ) {
     337        $per_page = (int) get_user_option( $option );
     338        if ( empty( $per_page ) || $per_page < 1 )
     339            $per_page = $default;
     340
     341        return (int) apply_filters( $option, $per_page );
    326342    }
    327343
Note: See TracChangeset for help on using the changeset viewer.