diff -r 3d4e9c994f10 -r a86126ab1dd4 wp/wp-admin/includes/class-wp-links-list-table.php --- a/wp/wp-admin/includes/class-wp-links-list-table.php Tue Oct 22 16:11:46 2019 +0200 +++ b/wp/wp-admin/includes/class-wp-links-list-table.php Tue Dec 15 13:49:49 2020 +0100 @@ -58,7 +58,7 @@ 'hide_empty' => 0, ); - if ( 'all' != $cat_id ) { + if ( 'all' !== $cat_id ) { $args['category'] = $cat_id; } if ( ! empty( $s ) ) { @@ -97,12 +97,12 @@ protected function extra_tablenav( $which ) { global $cat_id; - if ( 'top' != $which ) { + if ( 'top' !== $which ) { return; } ?>
- $cat_id, 'name' => 'cat_id', @@ -117,7 +117,7 @@ echo ''; wp_dropdown_categories( $dropdown_options ); submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) ); - ?> + ?>
- + %s', $edit_link, - /* translators: %s: link name */ + /* translators: %s: Link name. */ esc_attr( sprintf( __( 'Edit “%s”' ), $link->link_name ) ), $link->link_name ); @@ -223,7 +228,7 @@ echo $cat->get_error_message(); } $cat_name = $cat->name; - if ( $cat_id != $category ) { + if ( (int) $cat_id !== $category ) { $cat_name = "$cat_name"; } $cat_names[] = $cat_name; @@ -309,7 +314,8 @@ * @param object $link Link being acted upon. * @param string $column_name Current column name. * @param string $primary Primary column name. - * @return string Row action output for links. + * @return string Row actions output for links, or an empty string + * if the current column is not the primary column. */ protected function handle_row_actions( $link, $column_name, $primary ) { if ( $primary !== $column_name ) { @@ -320,7 +326,14 @@ $actions = array(); $actions['edit'] = '' . __( 'Edit' ) . ''; - $actions['delete'] = "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' ) . ''; + $actions['delete'] = sprintf( + '%s', + wp_nonce_url( "link.php?action=delete&link_id=$link->link_id", 'delete-bookmark_' . $link->link_id ), + /* translators: %s: Link name. */ + esc_js( sprintf( __( "You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete." ), $link->link_name ) ), + __( 'Delete' ) + ); + return $this->row_actions( $actions ); } }