Changeset 16127 for trunk/wp-admin/includes/class-wp-list-table.php
- Timestamp:
- 11/01/2010 08:56:27 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/class-wp-list-table.php
r16125 r16127 1 1 <?php 2 2 /** 3 * Base class and helper functionsfor displaying a list of items in an ajaxified HTML table.3 * Base class for displaying a list of items in an ajaxified HTML table. 4 4 * 5 5 * @package WordPress … … 817 817 } 818 818 } 819 820 /**821 * Fetch an instance of a WP_List_Table class.822 *823 * @since 3.1.0824 *825 * @param string $class The type of the list table, which is the class name except for core list tables.826 * @return object|bool Object on success, false if the class does not exist.827 */828 function get_list_table( $class ) {829 $class = apply_filters( "get_list_table_$class", $class );830 831 require_list_table( $class );832 833 if ( class_exists( $class ) )834 return new $class;835 return false;836 }837 838 /**839 * Include the proper file for a core list table.840 *841 * Useful for extending a core class that would not otherwise be required.842 *843 * @since 3.1.0844 *845 * @param string $table The core table to include.846 * @return bool True on success, false on failure.847 */848 function require_list_table( $class ) {849 $core_classes = array(850 'WP_Posts_Table' => 'posts',851 'WP_Media_Table' => 'media',852 'WP_Terms_Table' => 'terms',853 'WP_Users_Table' => 'users',854 'WP_Comments_Table' => 'comments',855 'WP_Post_Comments_Table' => 'comments',856 'WP_Links_Table' => 'links',857 'WP_Sites_Table' => 'sites',858 'WP_MS_Users_Table' => 'ms-users',859 'WP_Plugins_Table' => 'plugins',860 'WP_Plugin_Install_Table' => 'plugin-install',861 'WP_Themes_Table' => 'themes',862 'WP_Theme_Install_Table' => 'theme-install',863 'WP_MS_Themes_Table' => 'ms-themes',864 );865 866 if ( isset( $core_classes[ $class ] ) ) {867 require_once( ABSPATH . '/wp-admin/includes/list-table-' . $core_classes[ $class ] . '.php' );868 return true;869 }870 return false;871 }872 873 819 ?>
Note: See TracChangeset
for help on using the changeset viewer.