- Timestamp:
- 11/30/2017 11:09:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-links-list-table.php
r41161 r42343 28 28 */ 29 29 public function __construct( $args = array() ) { 30 parent::__construct( array( 31 'plural' => 'bookmarks', 32 'screen' => isset( $args['screen'] ) ? $args['screen'] : null, 33 ) ); 34 } 35 36 /** 37 * 30 parent::__construct( 31 array( 32 'plural' => 'bookmarks', 33 'screen' => isset( $args['screen'] ) ? $args['screen'] : null, 34 ) 35 ); 36 } 37 38 /** 38 39 * @return bool 39 40 */ … … 43 44 44 45 /** 45 *46 46 * @global int $cat_id 47 47 * @global string $s … … 54 54 wp_reset_vars( array( 'action', 'cat_id', 'link_id', 'orderby', 'order', 's' ) ); 55 55 56 $args = array( 'hide_invisible' => 0, 'hide_empty' => 0 ); 57 58 if ( 'all' != $cat_id ) 56 $args = array( 57 'hide_invisible' => 0, 58 'hide_empty' => 0, 59 ); 60 61 if ( 'all' != $cat_id ) { 59 62 $args['category'] = $cat_id; 60 if ( !empty( $s ) ) 63 } 64 if ( ! empty( $s ) ) { 61 65 $args['search'] = $s; 62 if ( !empty( $orderby ) ) 66 } 67 if ( ! empty( $orderby ) ) { 63 68 $args['orderby'] = $orderby; 64 if ( !empty( $order ) ) 69 } 70 if ( ! empty( $order ) ) { 65 71 $args['order'] = $order; 72 } 66 73 67 74 $this->items = get_bookmarks( $args ); … … 75 82 76 83 /** 77 *78 84 * @return array 79 85 */ 80 86 protected function get_bulk_actions() { 81 $actions = array();87 $actions = array(); 82 88 $actions['delete'] = __( 'Delete' ); 83 89 … … 86 92 87 93 /** 88 *89 94 * @global int $cat_id 90 95 * @param string $which … … 93 98 global $cat_id; 94 99 95 if ( 'top' != $which ) 100 if ( 'top' != $which ) { 96 101 return; 102 } 97 103 ?> 98 104 <div class="alignleft actions"> 99 105 <?php 100 106 $dropdown_options = array( 101 'selected' => $cat_id,102 'name' => 'cat_id',103 'taxonomy' => 'link_category',107 'selected' => $cat_id, 108 'name' => 'cat_id', 109 'taxonomy' => 'link_category', 104 110 'show_option_all' => get_taxonomy( 'link_category' )->labels->all_items, 105 'hide_empty' => true,106 'hierarchical' => 1,107 'show_count' => 0,108 'orderby' => 'name',111 'hide_empty' => true, 112 'hierarchical' => 1, 113 'show_count' => 0, 114 'orderby' => 'name', 109 115 ); 110 116 … … 118 124 119 125 /** 120 *121 126 * @return array 122 127 */ … … 129 134 'rel' => __( 'Relationship' ), 130 135 'visible' => __( 'Visible' ), 131 'rating' => __( 'Rating' ) 132 ); 133 } 134 135 /** 136 * 136 'rating' => __( 'Rating' ), 137 ); 138 } 139 140 /** 137 141 * @return array 138 142 */ … … 142 146 'url' => 'url', 143 147 'visible' => 'visible', 144 'rating' => 'rating' 148 'rating' => 'rating', 145 149 ); 146 150 } … … 180 184 public function column_name( $link ) { 181 185 $edit_link = get_edit_bookmark_link( $link ); 182 printf( '<strong><a class="row-title" href="%s" aria-label="%s">%s</a></strong>', 186 printf( 187 '<strong><a class="row-title" href="%s" aria-label="%s">%s</a></strong>', 183 188 $edit_link, 184 189 /* translators: %s: link name */ … … 286 291 public function display_rows() { 287 292 foreach ( $this->items as $link ) { 288 $link = sanitize_bookmark( $link );289 $link->link_name = esc_attr( $link->link_name );293 $link = sanitize_bookmark( $link ); 294 $link->link_name = esc_attr( $link->link_name ); 290 295 $link->link_category = wp_get_link_cats( $link->link_id ); 291 296 ?> 292 297 <tr id="link-<?php echo $link->link_id; ?>"> 293 <?php $this->single_row_columns( $link ) ?>298 <?php $this->single_row_columns( $link ); ?> 294 299 </tr> 295 300 <?php … … 314 319 $edit_link = get_edit_bookmark_link( $link ); 315 320 316 $actions = array();317 $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>';318 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url( "link.php?action=delete&link_id=$link->link_id", 'delete-bookmark_' . $link->link_id) . "' onclick=\"if ( confirm( '" . esc_js(sprintf(__("You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete."), $link->link_name)) . "' ) ) { return true;}return false;\">" . __('Delete') . "</a>";321 $actions = array(); 322 $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>'; 323 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url( "link.php?action=delete&link_id=$link->link_id", 'delete-bookmark_' . $link->link_id ) . "' onclick=\"if ( confirm( '" . esc_js( sprintf( __( "You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete." ), $link->link_name ) ) . "' ) ) { return true;}return false;\">" . __( 'Delete' ) . '</a>'; 319 324 return $this->row_actions( $actions ); 320 325 }
Note: See TracChangeset
for help on using the changeset viewer.