]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/includes/class-wp-list-table.php
WordPress 3.9.1-scripts
[autoinstalls/wordpress.git] / wp-admin / includes / class-wp-list-table.php
index bab488ec7cb792d6672278bd3f55710bee4f89dd..3aa066d8afb8163eda145ee607bbdc27c8b9e36f 100644 (file)
@@ -1,12 +1,4 @@
 <?php
-/**
- * Base class for displaying a list of items in an ajaxified HTML table.
- *
- * @package WordPress
- * @subpackage List_Table
- * @since 3.1.0
- */
-
 /**
  * Base class for displaying a list of items in an ajaxified HTML table.
  *
@@ -244,7 +236,17 @@ class WP_List_Table {
         */
        function views() {
                $views = $this->get_views();
-               $views = apply_filters( 'views_' . $this->screen->id, $views );
+               /**
+                * Filter the list of available list table views.
+                *
+                * The dynamic portion of the hook name, $this->screen->id, refers
+                * to the ID of the current screen, usually a string.
+                *
+                * @since 3.5.0
+                *
+                * @param array $views An array of available list table views.
+                */
+               $views = apply_filters( "views_{$this->screen->id}", $views );
 
                if ( empty( $views ) )
                        return;
@@ -279,8 +281,19 @@ class WP_List_Table {
        function bulk_actions() {
                if ( is_null( $this->_actions ) ) {
                        $no_new_actions = $this->_actions = $this->get_bulk_actions();
-                       // This filter can currently only be used to remove actions.
-                       $this->_actions = apply_filters( 'bulk_actions-' . $this->screen->id, $this->_actions );
+                       /**
+                        * Filter the list table Bulk Actions drop-down.
+                        *
+                        * The dynamic portion of the hook name, $this->screen->id, refers
+                        * to the ID of the current screen, usually a string.
+                        *
+                        * This filter can currently only be used to remove bulk actions.
+                        *
+                        * @since 3.5.0
+                        *
+                        * @param array $actions An array of the available bulk actions.
+                        */
+                       $this->_actions = apply_filters( "bulk_actions-{$this->screen->id}", $this->_actions );
                        $this->_actions = array_intersect_assoc( $this->_actions, $no_new_actions );
                        $two = '';
                } else {
@@ -368,11 +381,11 @@ class WP_List_Table {
                ", $post_type ) );
 
                /**
-                * Filter the months dropdown results.
+                * Filter the 'Months' drop-down results.
                 *
                 * @since 3.7.0
                 *
-                * @param object $months    The months dropdown query results.
+                * @param object $months    The months drop-down query results.
                 * @param string $post_type The post type.
                 */
                $months = apply_filters( 'months_dropdown_results', $months, $post_type );
@@ -385,7 +398,7 @@ class WP_List_Table {
                $m = isset( $_GET['m'] ) ? (int) $_GET['m'] : 0;
 ?>
                <select name='m'>
-                       <option<?php selected( $m, 0 ); ?> value='0'><?php _e( 'Show all dates' ); ?></option>
+                       <option<?php selected( $m, 0 ); ?> value='0'><?php _e( 'All dates' ); ?></option>
 <?php
                foreach ( $months as $arc_row ) {
                        if ( 0 == $arc_row->year )
@@ -482,6 +495,18 @@ class WP_List_Table {
                if ( empty( $per_page ) || $per_page < 1 )
                        $per_page = $default;
 
+               /**
+                * Filter the number of items to be displayed on each page of the list table.
+                *
+                * The dynamic hook name, $option, refers to the per page option depending
+                * on the type of list table in use. Possible values may include:
+                * 'edit_comments_per_page', 'sites_network_per_page', 'site_themes_network_per_page',
+                * 'themes_netework_per_page', 'users_network_per_page', 'edit_{$post_type}', etc.
+                *
+                * @since 2.9.0
+                *
+                * @param int $per_page Number of items to be displayed. Default 20.
+                */
                return (int) apply_filters( $option, $per_page );
        }
 
@@ -614,7 +639,18 @@ class WP_List_Table {
                $columns = get_column_headers( $this->screen );
                $hidden = get_hidden_columns( $this->screen );
 
-               $_sortable = apply_filters( "manage_{$this->screen->id}_sortable_columns", $this->get_sortable_columns() );
+               $sortable_columns = $this->get_sortable_columns();
+               /**
+                * Filter the list table sortable columns for a specific screen.
+                *
+                * The dynamic portion of the hook name, $this->screen->id, refers
+                * to the ID of the current screen, usually a string.
+                *
+                * @since 3.5.0
+                *
+                * @param array $sortable_columns An array of sortable columns.
+                */
+               $_sortable = apply_filters( "manage_{$this->screen->id}_sortable_columns", $sortable_columns );
 
                $sortable = array();
                foreach ( $_sortable as $id => $data ) {
@@ -729,7 +765,7 @@ class WP_List_Table {
                $this->display_tablenav( 'top' );
 
 ?>
-<table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>" cellspacing="0">
+<table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
        <thead>
        <tr>
                <?php $this->print_column_headers(); ?>