@@ -235,26 +235,22 @@ protected function column_title( $item ) {
235
235
$ edit_link = '' ;
236
236
$ term_title = 'NOT SET ' ;
237
237
238
- if ( isset ( $ item ['ID ' ] ) && isset ( $ item ['type ' ] ) ) {
239
- $ taxonomy_type = 'category ' ;
240
- if ( 'tag ' === $ item ['type ' ] ) {
241
- $ taxonomy_type = 'post_tag ' ;
242
- }
243
-
244
- $ edit_link = get_edit_term_link ( $ item ['ID ' ], $ taxonomy_type );
245
- $ term = get_term ( $ item ['ID ' ], $ taxonomy_type );
238
+ if ( isset ( $ item ['ID ' ] ) ) {
239
+ $ edit_link = get_edit_term_link ( $ item ['ID ' ] );
240
+ $ term = get_term ( $ item ['ID ' ] );
246
241
247
- if ( isset ( $ term ) && isset ( $ term ->name ) && ! empty ( $ term ->name ) ) {
242
+ if ( isset ( $ term, $ term ->name ) && ! empty ( $ term ->name ) ) {
248
243
$ term_title = $ term ->name ;
249
244
}
250
245
}
251
246
252
- $ title_with_edit_link = $ term_title ;
247
+ $ title_with_edit_link = esc_html ( $ term_title ) ;
253
248
if ( ! empty ( $ edit_link ) ) {
254
249
$ title_with_edit_link = sprintf (
255
- '<a href="%s" target="_blank" title=" ' . esc_html__ ( 'Edit ' , 'custom-permalinks ' ) . ' ' . $ term_title . '">%s</a> ' ,
256
- $ edit_link ,
257
- $ term_title
250
+ '<a href="%1s" target="_blank" title="%2s">%3s</a> ' ,
251
+ esc_url ( $ edit_link ),
252
+ esc_attr__ ( 'Edit ' , 'custom-permalinks ' ) . ' ' . esc_attr ( $ term_title ),
253
+ $ title_with_edit_link
258
254
);
259
255
}
260
256
@@ -312,6 +308,7 @@ protected function column_permalink( $item ) {
312
308
}
313
309
}
314
310
311
+ $ taxonomy_type = $ item ['type ' ];
315
312
if ( 'tag ' === $ item ['type ' ] ) {
316
313
$ taxonomy_type = 'post_tag ' ;
317
314
}
@@ -333,17 +330,18 @@ protected function column_permalink( $item ) {
333
330
$ perm_text = str_replace ( $ home_url , '' , $ permalink );
334
331
335
332
$ term_title = '' ;
336
- if ( isset ( $ item ['ID ' ] ) && isset ( $ item [ ' type ' ] ) ) {
337
- $ term = get_term ( $ item ['ID ' ], $ item [ ' type ' ] );
338
- if ( isset ( $ term ) && isset ( $ term ->name ) && ! empty ( $ term ->name ) ) {
333
+ if ( isset ( $ item ['ID ' ] ) ) {
334
+ $ term = get_term ( $ item ['ID ' ] );
335
+ if ( isset ( $ term, $ term ->name ) && ! empty ( $ term ->name ) ) {
339
336
$ term_title = $ term ->name ;
340
337
}
341
338
}
342
339
343
340
$ permalink = sprintf (
344
- '<a href="%s" target="_blank" title=" ' . esc_html__ ( 'Visit ' , 'custom-permalinks ' ) . ' ' . $ term_title . '">%s</a> ' ,
345
- $ permalink ,
346
- $ perm_text
341
+ '<a href="%1s" target="_blank" title="%2s">%3s</a> ' ,
342
+ esc_url ( $ permalink ),
343
+ esc_attr__ ( 'Visit ' , 'custom-permalinks ' ) . ' ' . esc_attr ( $ term_title ),
344
+ esc_html ( $ perm_text )
347
345
);
348
346
}
349
347
0 commit comments