X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/f9001779751f83dc8a10e478bfecb4d8dd5f964c..5d244c8fd9a27c9f89dd08da2af6fbc67d4fce63:/wp-admin/includes/class-wp-links-list-table.php diff --git a/wp-admin/includes/class-wp-links-list-table.php b/wp-admin/includes/class-wp-links-list-table.php index bf1c0bc6..3a390635 100644 --- a/wp-admin/includes/class-wp-links-list-table.php +++ b/wp-admin/includes/class-wp-links-list-table.php @@ -9,20 +9,31 @@ */ class WP_Links_List_Table extends WP_List_Table { - function WP_Links_List_Table() { - parent::WP_List_Table( array( + /** + * Constructor. + * + * @since 3.1.0 + * @access public + * + * @see WP_List_Table::__construct() for more information on default arguments. + * + * @param array $args An associative array of arguments. + */ + public function __construct( $args = array() ) { + parent::__construct( array( 'plural' => 'bookmarks', + 'screen' => isset( $args['screen'] ) ? $args['screen'] : null, ) ); } - function ajax_user_can() { + public function ajax_user_can() { return current_user_can( 'manage_links' ); } - function prepare_items() { + public function prepare_items() { global $cat_id, $s, $orderby, $order; - wp_reset_vars( array( 'action', 'cat_id', 'linkurl', 'name', 'image', 'description', 'visible', 'target', 'category', 'link_id', 'submit', 'orderby', 'order', 'links_show_cat_id', 'rating', 'rel', 'notes', 'linkcheck[]', 's' ) ); + wp_reset_vars( array( 'action', 'cat_id', 'link_id', 'orderby', 'order', 's' ) ); $args = array( 'hide_invisible' => 0, 'hide_empty' => 0 ); @@ -38,18 +49,18 @@ class WP_Links_List_Table extends WP_List_Table { $this->items = get_bookmarks( $args ); } - function no_items() { + public function no_items() { _e( 'No links found.' ); } - function get_bulk_actions() { + protected function get_bulk_actions() { $actions = array(); $actions['delete'] = __( 'Delete' ); return $actions; } - function extra_tablenav( $which ) { + protected function extra_tablenav( $which ) { global $cat_id; if ( 'top' != $which ) @@ -61,23 +72,25 @@ class WP_Links_List_Table extends WP_List_Table { 'selected' => $cat_id, 'name' => 'cat_id', 'taxonomy' => 'link_category', - 'show_option_all' => __( 'View all categories' ), + 'show_option_all' => __( 'All categories' ), 'hide_empty' => true, 'hierarchical' => 1, 'show_count' => 0, 'orderby' => 'name', ); + + echo ''; wp_dropdown_categories( $dropdown_options ); - submit_button( __( 'Filter' ), 'secondary', false, false, array( 'id' => 'post-query-submit' ) ); + submit_button( __( 'Filter' ), 'button', 'filter_action', false, array( 'id' => 'post-query-submit' ) ); ?> '', - 'name' => __( 'Name' ), + 'name' => _x( 'Name', 'link name' ), 'url' => __( 'URL' ), 'categories' => __( 'Categories' ), 'rel' => __( 'Relationship' ), @@ -86,7 +99,7 @@ class WP_Links_List_Table extends WP_List_Table { ); } - function get_sortable_columns() { + protected function get_sortable_columns() { return array( 'name' => 'name', 'url' => 'url', @@ -95,7 +108,7 @@ class WP_Links_List_Table extends WP_List_Table { ); } - function display_rows() { + public function display_rows() { global $cat_id; $alt = 0; @@ -113,7 +126,7 @@ class WP_Links_List_Table extends WP_List_Table { $edit_link = get_edit_bookmark_link( $link ); ?> - > + > get_column_info(); @@ -128,8 +141,12 @@ class WP_Links_List_Table extends WP_List_Table { $attributes = $class . $style; switch ( $column_name ) { - case 'cb': - echo ''; + case 'cb': ?> + + + + + - >link_id ); ?> + >link_id ); + ?>