WordPress 3.8
[autoinstalls/wordpress.git] / wp-admin / includes / class-wp-links-list-table.php
index bf1c0bc63b3ca3f305e1d2575535c01e9b7d4d8f..61d8c176b468a0219d0492d1ff69818ae0b381ec 100644 (file)
@@ -9,9 +9,10 @@
  */
 class WP_Links_List_Table extends WP_List_Table {
 
  */
 class WP_Links_List_Table extends WP_List_Table {
 
-       function WP_Links_List_Table() {
-               parent::WP_List_Table( array(
+       function __construct( $args = array() ) {
+               parent::__construct( array(
                        'plural' => 'bookmarks',
                        'plural' => 'bookmarks',
+                       'screen' => isset( $args['screen'] ) ? $args['screen'] : null,
                ) );
        }
 
                ) );
        }
 
@@ -22,7 +23,7 @@ class WP_Links_List_Table extends WP_List_Table {
        function prepare_items() {
                global $cat_id, $s, $orderby, $order;
 
        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 );
 
 
                $args = array( 'hide_invisible' => 0, 'hide_empty' => 0 );
 
@@ -68,7 +69,7 @@ class WP_Links_List_Table extends WP_List_Table {
                                'orderby' => 'name',
                        );
                        wp_dropdown_categories( $dropdown_options );
                                'orderby' => 'name',
                        );
                        wp_dropdown_categories( $dropdown_options );
-                       submit_button( __( 'Filter' ), 'secondary', false, false, array( 'id' => 'post-query-submit' ) );
+                       submit_button( __( 'Filter' ), 'button', false, false, array( 'id' => 'post-query-submit' ) );
 ?>
                </div>
 <?php
 ?>
                </div>
 <?php
@@ -77,7 +78,7 @@ class WP_Links_List_Table extends WP_List_Table {
        function get_columns() {
                return array(
                        'cb'         => '<input type="checkbox" />',
        function get_columns() {
                return array(
                        'cb'         => '<input type="checkbox" />',
-                       'name'       => __( 'Name' ),
+                       'name'       => _x( 'Name', 'link name' ),
                        'url'        => __( 'URL' ),
                        'categories' => __( 'Categories' ),
                        'rel'        => __( 'Relationship' ),
                        'url'        => __( 'URL' ),
                        'categories' => __( 'Categories' ),
                        'rel'        => __( 'Relationship' ),
@@ -128,8 +129,12 @@ class WP_Links_List_Table extends WP_List_Table {
                                $attributes = $class . $style;
 
                                switch ( $column_name ) {
                                $attributes = $class . $style;
 
                                switch ( $column_name ) {
-                                       case 'cb':
-                                               echo '<th scope="row" class="check-column"><input type="checkbox" name="linkcheck[]" value="'. esc_attr( $link->link_id ) .'" /></th>';
+                                       case 'cb': ?>
+                                               <th scope="row" class="check-column">
+                                                       <label class="screen-reader-text" for="cb-select-<?php echo $link->link_id; ?>"><?php echo sprintf( __( 'Select %s' ), $link->link_name ); ?></label>
+                                                       <input type="checkbox" name="linkcheck[]" id="cb-select-<?php echo $link->link_id; ?>" value="<?php echo esc_attr( $link->link_id ); ?>" />
+                                               </th>
+                                               <?php
                                                break;
 
                                        case 'name':
                                                break;
 
                                        case 'name':
@@ -170,6 +175,14 @@ class WP_Links_List_Table extends WP_List_Table {
                                                ?><td <?php echo $attributes ?>><?php echo $rating; ?></td><?php
                                                break;
                                        default:
                                                ?><td <?php echo $attributes ?>><?php echo $rating; ?></td><?php
                                                break;
                                        default:
+                                               /**
+                                                * Fires for each registered custom link column.
+                                                *
+                                                * @since 2.1.0
+                                                *
+                                                * @param string $column_name Name of the custom column.
+                                                * @param int    $link_id     Link ID.
+                                                */
                                                ?>
                                                <td <?php echo $attributes ?>><?php do_action( 'manage_link_custom_column', $column_name, $link->link_id ); ?></td>
                                                <?php
                                                ?>
                                                <td <?php echo $attributes ?>><?php do_action( 'manage_link_custom_column', $column_name, $link->link_id ); ?></td>
                                                <?php
@@ -182,5 +195,3 @@ class WP_Links_List_Table extends WP_List_Table {
                }
        }
 }
                }
        }
 }
-
-?>