- Timestamp:
- 05/29/2015 02:40:52 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-terms-list-table.php
r32642 r32644 308 308 public function column_name( $tag ) { 309 309 $taxonomy = $this->screen->taxonomy; 310 $tax = get_taxonomy( $taxonomy );311 312 $default_term = get_option( 'default_' . $taxonomy );313 310 314 311 $pad = str_repeat( '— ', max( 0, $this->level ) ); … … 334 331 $out = '<strong><a class="row-title" href="' . $edit_link . '" title="' . esc_attr( sprintf( __( 'Edit “%s”' ), $name ) ) . '">' . $name . '</a></strong><br />'; 335 332 336 $actions = array();337 if ( current_user_can( $tax->cap->edit_terms ) ) {338 $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>';339 $actions['inline hide-if-no-js'] = '<a href="#" class="editinline">' . __( 'Quick Edit' ) . '</a>';340 }341 if ( current_user_can( $tax->cap->delete_terms ) && $tag->term_id != $default_term )342 $actions['delete'] = "<a class='delete-tag' href='" . wp_nonce_url( "edit-tags.php?action=delete&taxonomy=$taxonomy&tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id ) . "'>" . __( 'Delete' ) . "</a>";343 if ( $tax->public )344 $actions['view'] = '<a href="' . get_term_link( $tag ) . '">' . __( 'View' ) . '</a>';345 346 /**347 * Filter the action links displayed for each term in the Tags list table.348 *349 * @since 2.8.0350 * @deprecated 3.0.0 Use {$taxonomy}_row_actions instead.351 *352 * @param array $actions An array of action links to be displayed. Default353 * 'Edit', 'Quick Edit', 'Delete', and 'View'.354 * @param object $tag Term object.355 */356 $actions = apply_filters( 'tag_row_actions', $actions, $tag );357 358 /**359 * Filter the action links displayed for each term in the terms list table.360 *361 * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.362 *363 * @since 3.0.0364 *365 * @param array $actions An array of action links to be displayed. Default366 * 'Edit', 'Quick Edit', 'Delete', and 'View'.367 * @param object $tag Term object.368 */369 $actions = apply_filters( "{$taxonomy}_row_actions", $actions, $tag );370 371 $out .= $this->row_actions( $actions );372 333 $out .= '<div class="hidden" id="inline_' . $qe_data->term_id . '">'; 373 334 $out .= '<div class="name">' . $qe_data->name . '</div>'; … … 378 339 379 340 return $out; 341 } 342 343 /** 344 * Get name of default primary column 345 * 346 * @since 4.3.0 347 * @access protected 348 * 349 * @return string 350 */ 351 protected function get_default_primary_column_name() { 352 return 'name'; 353 } 354 355 /** 356 * Generate and display row actions links 357 * 358 * @since 4.3.0 359 * @access protected 360 * 361 * @param object $tag Tag being acted upon 362 * @param string $column_name Current column name 363 * @param string $primary Primary column name 364 * 365 * @return string 366 */ 367 protected function handle_row_actions( $tag, $column_name, $primary ) { 368 $taxonomy = $this->screen->taxonomy; 369 $tax = get_taxonomy( $taxonomy ); 370 $default_term = get_option( 'default_' . $taxonomy ); 371 372 $edit_link = esc_url( get_edit_term_link( $tag->term_id, $taxonomy, $this->screen->post_type ) ); 373 374 if ( $primary === $column_name ) { 375 $actions = array(); 376 if ( current_user_can( $tax->cap->edit_terms ) ) { 377 $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>'; 378 $actions['inline hide-if-no-js'] = '<a href="#" class="editinline">' . __( 'Quick Edit' ) . '</a>'; 379 } 380 if ( current_user_can( $tax->cap->delete_terms ) && $tag->term_id != $default_term ) 381 $actions['delete'] = "<a class='delete-tag' href='" . wp_nonce_url( "edit-tags.php?action=delete&taxonomy=$taxonomy&tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id ) . "'>" . __( 'Delete' ) . "</a>"; 382 if ( $tax->public ) 383 $actions['view'] = '<a href="' . get_term_link( $tag ) . '">' . __( 'View' ) . '</a>'; 384 385 /** 386 * Filter the action links displayed for each term in the Tags list table. 387 * 388 * @since 2.8.0 389 * @deprecated 3.0.0 Use {$taxonomy}_row_actions instead. 390 * 391 * @param array $actions An array of action links to be displayed. Default 392 * 'Edit', 'Quick Edit', 'Delete', and 'View'. 393 * @param object $tag Term object. 394 */ 395 $actions = apply_filters( 'tag_row_actions', $actions, $tag ); 396 397 /** 398 * Filter the action links displayed for each term in the terms list table. 399 * 400 * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug. 401 * 402 * @since 3.0.0 403 * 404 * @param array $actions An array of action links to be displayed. Default 405 * 'Edit', 'Quick Edit', 'Delete', and 'View'. 406 * @param object $tag Term object. 407 */ 408 $actions = apply_filters( "{$taxonomy}_row_actions", $actions, $tag ); 409 410 return $this->row_actions( $actions ); 411 } 380 412 } 381 413
Note: See TracChangeset
for help on using the changeset viewer.