d> 1 年之前 16793 058f31828c first commit 1 年之前 16795 058f31828c first commit 1 年之前 16797 058f31828c first commit 1 年之前 16800 058f31828c first commit 1 年之前 16802 058f31828c first commit 1 年之前 16803 058f31828c first commit 1 年之前 16805 058f31828c first commit 1 年之前 16807 058f31828c first commit 1 年之前 16810 058f31828c first commit 1 年之前 16812 058f31828c first commit 1 年之前 16814 058f31828c first commit 1 年之前 16817 058f31828c first commit 1 年之前 16819 058f31828c first commit 1 年之前 16821 058f31828c first commit 1 年之前 16824 058f31828c first commit 1 年之前 16831 058f31828c first commit 1 年之前 16832 058f31828c first commit 1 年之前 16843 058f31828c first commit 1 年之前 16844 058f31828c first commit 1 年之前 16850 058f31828c first commit 1 年之前 16856 058f31828c first commit 1 年之前 16862 058f31828c first commit 1 年之前 16868 058f31828c first commit 1 年之前 16869 058f31828c first commit 1 年之前 16871 058f31828c first commit 1 年之前 16874 058f31828c first commit 1 年之前 16876 058f31828c first commit 1 年之前 16877 058f31828c first commit 1 年之前 16879 058f31828c first commit 1 年之前 16887 058f31828c first commit 1 年之前 16889 058f31828c first commit 1 年之前 16892 058f31828c first commit 1 年之前 16896 058f31828c first commit 1 年之前 16898 058f31828c first commit 1 年之前 16901 058f31828c first commit 1 年之前 16903 058f31828c first commit 1 年之前 16911 058f31828c first commit 1 年之前 16917 058f31828c first commit 1 年之前 16918 058f31828c first commit 1 年之前 16922 058f31828c first commit 1 年之前 16924 058f31828c first commit 1 年之前 16926 058f31828c first commit 1 年之前 16927 058f31828c first commit 1 年之前 16928 058f31828c first commit 1 年之前 16929 058f31828c first commit 1 年之前 16932 058f31828c first commit 1 年之前 16934 058f31828c first commit 1 年之前 16941 058f31828c first commit 1 年之前 16942 058f31828c first commit 1 年之前 16944 058f31828c first commit 1 年之前 16947 058f31828c first commit 1 年之前 16949 058f31828c first commit 1 年之前 16951 058f31828c first commit 1 年之前 16952 058f31828c first commit 1 年之前 16962 058f31828c first commit 1 年之前 16964 058f31828c first commit 1 年之前 16967 058f31828c first commit 1 年之前 16969 058f31828c first commit 1 年之前 16971 058f31828c first commit 1 年之前 16974 058f31828c first commit 1 年之前 16976 058f31828c first commit 1 年之前 16978 058f31828c first commit 1 年之前 16981 058f31828c first commit 1 年之前 16983 058f31828c first commit 1 年之前 16984 058f31828c first commit 1 年之前 16986 058f31828c first commit 1 年之前 16996 058f31828c first commit 1 年之前 17008 058f31828c first commit 1 年之前 17009 058f31828c first commit 1 年之前 17020 058f31828c first commit 1 年之前 17021 058f31828c first commit 1 年之前 17022 058f31828c first commit 1 年之前 17024 058f31828c first commit 1 年之前 17034 058f31828c first commit 1 年之前 17037 058f31828c first commit 1 年之前 17039 058f31828c first commit 1 年之前 17040 058f31828c first commit 1 年之前 17041 058f31828c first commit 1 年之前 17042 058f31828c first commit 1 年之前 174 058f31828c first commit 1 年之前 175 058f31828c first commit 1 年之前 2187 058f31828c first commit 1 年之前 2224 058f31828c first commit 1 年之前 2328 058f31828c first commit 1 年之前 2336 058f31828c first commit 1 年之前 2337 058f31828c first commit 1 年之前 2579 058f31828c first commit 1 年之前 2600 058f31828c first commit 1 年之前 2600_fsm 058f31828c first commit 1 年之前 2600_vm 058f31828c first commit 1 年之前 2601 058f31828c first commit 1 年之前 2601_fsm 058f31828c first commit 1 年之前 2601_vm 058f31828c first commit 1 年之前 2602 058f31828c first commit 1 年之前 2602_fsm 058f31828c first commit 1 年之前 2602_vm 058f31828c first commit 1 年之前 2603 058f31828c first commit 1 年之前 2603_fsm 058f31828c first commit 1 年之前 2603_vm 058f31828c first commit 1 年之前 2604 058f31828c first commit 1 年之前 2605 058f31828c first commit 1 年之前 2605_fsm 058f31828c first commit 1 年之前 2605_vm 058f31828c first commit 1 年之前 2606 058f31828c first commit 1 年之前 2606_fsm 058f31828c first commit 1 年之前 2606_vm 058f31828c first commit 1 年之前 2607 058f31828c first commit 1 年之前 2607_fsm 058f31828c first commit 1 年之前 2607_vm 058f31828c first commit 1 年之前 2608 058f31828c first commit 1 年之前 2608_fsm 058f31828c first commit 1 年之前 2608_vm 058f31828c first commit 1 年之前 2609 058f31828c first commit 1 年之前 2609_fsm 058f31828c first commit 1 年之前 2609_vm 058f31828c first commit 1 年之前 2610 058f31828c first commit 1 年之前 2610_fsm 058f31828c first commit 1 年之前 2610_vm 058f31828c first commit 1 年之前 2611 058f31828c first commit 1 年之前 2612 058f31828c first commit 1 年之前 2612_fsm 058f31828c first commit 1 年之前 2612_vm 058f31828c first commit 1 年之前 2613 058f31828c first commit 1 年之前 2615 058f31828c first commit 1 年之前 2615_fsm 058f31828c first commit 1 年之前 2615_vm 058f31828c first commit 1 年之前 2616 058f31828c first commit 1 年之前 2616_fsm 058f31828c first commit 1 年之前 2616_vm 058f31828c first commit 1 年之前 2617 058f31828c first commit 1 年之前 2617_fsm 058f31828c first commit 1 年之前 2617_vm 058f31828c first commit 1 年之前 2618 058f31828c first commit 1 年之前 2618_fsm 058f31828c first commit 1 年之前 2618_vm 058f31828c first commit 1 年之前 2619 058f31828c first commit 1 年之前 2619_fsm 058f31828c first commit 1 年之前 2619_vm 058f31828c first commit 1 年之前 2620 058f31828c first commit 1 年之前 2620_fsm 058f31828c first commit 1 年之前 2650 058f31828c first commit 1 年之前 2651 058f31828c first commit 1 年之前 2652 058f31828c first commit 1 年之前 2653 058f31828c first commit 1 年之前 2654 058f31828c first commit 1 年之前 2655 058f31828c first commit 1 年之前 2656 058f31828c first commit 1 年之前 2657 058f31828c first commit 1 年之前 2658 058f31828c first commit 1 年之前 2659 058f31828c first commit 1 年之前 2660 058f31828c first commit 1 年之前 2661 058f31828c first commit 1 年之前 2662 058f31828c first commit 1 年之前 2663 058f31828c first commit 1 年之前 2664 058f31828c first commit 1 年之前 2665 058f31828c first commit 1 年之前 2666 058f31828c first commit 1 年之前 2667 058f31828c first commit 1 年之前 2668 058f31828c first commit 1 年之前 2669 058f31828c first commit 1 年之前 2670 058f31828c first commit 1 年之前 2673 058f31828c first commit 1 年之前 2674 058f31828c first commit 1 年之前 2675 058f31828c first commit 1 年之前 2678 058f31828c first commit 1 年之前 2679 058f31828c first commit 1 年之前 2680 058f31828c first commit 1 年之前 2681 058f31828c first commit 1 年之前 2682 058f31828c first commit 1 年之前 2683 058f31828c first commit 1 年之前 2684 058f31828c first commit 1 年之前 2685 058f31828c first commit 1 年之前 2686 058f31828c first commit 1 年之前 2687 058f31828c first commit 1 年之前 2688 058f31828c first commit 1 年之前 2689 058f31828c first commit 1 年之前 2690 058f31828c first commit 1 年之前 2691 058f31828c first commit 1 年之前 2692 058f31828c first commit 1 年之前 2693 058f31828c first commit 1 年之前 2696 058f31828c first commit 1 年之前 2699 058f31828c first commit 1 年之前 2701 058f31828c first commit 1 年之前 2702 058f31828c first commit 1 年之前 2703 058f31828c first commit 1 年之前 2704 058f31828c first commit 1 年之前 2753 058f31828c first commit 1 年之前 2753_fsm 058f31828c first commit 1 年之前 2753_vm 058f31828c first commit 1 年之前 2754 058f31828c first commit 1 年之前 2755 058f31828c first commit 1 年之前 2756 058f31828c first commit 1 年之前 2757 058f31828c first commit 1 年之前 2830 058f31828c first commit 1 年之前 2831 058f31828c first commit 1 年之前 2832 058f31828c first commit 1 年之前 2833 058f31828c first commit 1 年之前 2834 058f31828c first commit 1 年之前 2835 058f31828c first commit 1 年之前 2836 058f31828c first commit 1 年之前 2837 058f31828c first commit 1 年之前 2838 058f31828c first commit 1 年之前 2838_fsm 058f31828c first commit 1 年之前 2838_vm 058f31828c first commit 1 年之前 2839 058f31828c first commit 1 年之前 2840 058f31828c first commit 1 年之前 2840_fsm 058f31828c first commit 1 年之前 2840_vm 058f31828c first commit 1 年之前 2841 058f31828c first commit 1 年之前 2995 058f31828c first commit 1 年之前 2996 058f31828c first commit 1 年之前 3079 058f31828c first commit 1 年之前 3079_fsm 058f31828c first commit 1 年之前 3079_vm 058f31828c first commit 1 年之前 3080 058f31828c first commit 1 年之前 3081 058f31828c first commit 1 年之前 3085 058f31828c first commit 1 年之前 3118 058f31828c first commit 1 年之前 3119 058f31828c first commit 1 年之前 3164 058f31828c first commit 1 年之前 3256 058f31828c first commit 1 年之前 3257 058f31828c first commit 1 年之前 3258 058f31828c first commit 1 年之前 3350 058f31828c first commit 1 年之前 3351 058f31828c first commit 1 年之前 3379 058f31828c first commit 1 年之前 3380 058f31828c first commit 1 年之前 3381 058f31828c first commit 1 年之前 3394 058f31828c first commit 1 年之前 3394_fsm 058f31828c first commit 1 年之前 3394_vm 058f31828c first commit 1 年之前 3395 058f31828c first commit 1 年之前 3429 058f31828c first commit 1 年之前 3430 058f31828c first commit 1 年之前 3431 058f31828c first commit 1 年之前 3433 058f31828c first commit 1 年之前 3439 058f31828c first commit 1 年之前 3440 058f31828c first commit 1 年之前 3455 058f31828c first commit 1 年之前 3456 058f31828c first commit 1 年之前 3456_fsm 058f31828c first commit 1 年之前 3456_vm 058f31828c first commit 1 年之前 3466 058f31828c first commit 1 年之前 3467 058f31828c first commit 1 年之前 3468 058f31828c first commit 1 年之前 3501 058f31828c first commit 1 年之前 3502 058f31828c first commit 1 年之前 3503 058f31828c first commit 1 年之前 3534 058f31828c first commit 1 年之前 3541 058f31828c first commit 1 年之前 3541_fsm 058f31828c first commit 1 年之前 3541_vm 058f31828c first commit 1 年之前 3542 058f31828c first commit 1 年之前 3574 058f31828c first commit 1 年之前 3575 058f31828c first commit 1 年之前 3576 058f31828c first commit 1 年之前 3596 058f31828c first commit 1 年之前 3597 058f31828c first commit 1 年之前 3598 058f31828c first commit 1 年之前 3599 058f31828c first commit 1 年之前 3600 058f31828c first commit 1 年之前 3600_fsm 058f31828c first commit 1 年之前 3600_vm 058f31828c first commit 1 年之前 3601 058f31828c first commit 1 年之前 3601_fsm 058f31828c first commit 1 年之前 3601_vm 058f31828c first commit 1 年之前 3602 058f31828c first commit 1 年之前 3602_fsm 058f31828c first commit 1 年之前 3602_vm 058f31828c first commit 1 年之前 3603 058f31828c first commit 1 年之前 3603_fsm 058f31828c first commit 1 年之前 3603_vm 058f31828c first commit 1 年之前 3604 058f31828c first commit 1 年之前 3605 058f31828c first commit 1 年之前 3606 058f31828c first commit 1 年之前 3607 058f31828c first commit 1 年之前 3608 058f31828c first commit 1 年之前 3609 058f31828c first commit 1 年之前 3712 058f31828c first commit 1 年之前 3764 058f31828c first commit 1 年之前 3764_fsm 058f31828c first commit 1 年之前 3764_vm 058f31828c first commit 1 年之前 3766 058f31828c first commit 1 年之前 3767 058f31828c first commit 1 年之前 3997 058f31828c first commit 1 年之前 4143 058f31828c first commit 1 年之前 4144 058f31828c first commit 1 年之前 4145 058f31828c first commit 1 年之前 4146 058f31828c first commit 1 年之前 4147 058f31828c first commit 1 年之前 4148 058f31828c first commit 1 年之前 4149 058f31828c first commit 1 年之前 4150 058f31828c first commit 1 年之前 4151 058f31828c first commit 1 年之前 4152 058f31828c first commit 1 年之前 4153 058f31828c first commit 1 年之前 4154 058f31828c first commit 1 年之前 4155 058f31828c first commit 1 年之前 4156 058f31828c first commit 1 年之前 4157 058f31828c first commit 1 年之前 4158 058f31828c first commit 1 年之前 4159 058f31828c first commit 1 年之前 4160 058f31828c first commit 1 年之前 4161 058f31828c first commit 1 年之前 4162 058f31828c first commit 1 年之前 4163 058f31828c first commit 1 年之前 4164 058f31828c first commit 1 年之前 4165 058f31828c first commit 1 年之前 4166 058f31828c first commit 1 年之前 4167 058f31828c first commit 1 年之前 4168 058f31828c first commit 1 年之前 4169 058f31828c first commit 1 年之前 4170 058f31828c first commit 1 年之前 4171 058f31828c first commit 1 年之前 4172 058f31828c first commit 1 年之前 4173 058f31828c first commit 1 年之前 4174 058f31828c first commit 1 年之前 5002 058f31828c first commit 1 年之前 548 058f31828c first commit 1 年之前 549 058f31828c first commit 1 年之前 6102 058f31828c first commit 1 年之前 6104 058f31828c first commit 1 年之前 6106 058f31828c first commit 1 年之前 6110 058f31828c first commit 1 年之前 6111 058f31828c first commit 1 年之前 6112 058f31828c first commit 1 年之前 6113 058f31828c first commit 1 年之前 6117 058f31828c first commit 1 年之前 826 058f31828c first commit 1 年之前 827 058f31828c first commit 1 年之前 828 058f31828c first commit 1 年之前 PG_VERSION 058f31828c first commit 1 年之前 pg_filenode.map 058f31828c first commit 1 年之前 pg_internal.init 058f31828c first commit 1 年之前 tum/whitesports - Gogs: Simplico Git Service

Nessuna descrizione

class-wp-links-list-table.php 7.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. <?php
  2. /**
  3. * List Table API: WP_Links_List_Table class
  4. *
  5. * @package WordPress
  6. * @subpackage Administration
  7. * @since 3.1.0
  8. */
  9. /**
  10. * Core class used to implement displaying links in a list table.
  11. *
  12. * @since 3.1.0
  13. * @access private
  14. *
  15. * @see WP_List_Table
  16. */
  17. class WP_Links_List_Table extends WP_List_Table {
  18. /**
  19. * Constructor.
  20. *
  21. * @since 3.1.0
  22. *
  23. * @see WP_List_Table::__construct() for more information on default arguments.
  24. *
  25. * @param array $args An associative array of arguments.
  26. */
  27. public function __construct( $args = array() ) {
  28. parent::__construct(
  29. array(
  30. 'plural' => 'bookmarks',
  31. 'screen' => isset( $args['screen'] ) ? $args['screen'] : null,
  32. )
  33. );
  34. }
  35. /**
  36. * @return bool
  37. */
  38. public function ajax_user_can() {
  39. return current_user_can( 'manage_links' );
  40. }
  41. /**
  42. * @global int $cat_id
  43. * @global string $s
  44. * @global string $orderby
  45. * @global string $order
  46. */
  47. public function prepare_items() {
  48. global $cat_id, $s, $orderby, $order;
  49. wp_reset_vars( array( 'action', 'cat_id', 'link_id', 'orderby', 'order', 's' ) );
  50. $args = array(
  51. 'hide_invisible' => 0,
  52. 'hide_empty' => 0,
  53. );
  54. if ( 'all' !== $cat_id ) {
  55. $args['category'] = $cat_id;
  56. }
  57. if ( ! empty( $s ) ) {
  58. $args['search'] = $s;
  59. }
  60. if ( ! empty( $orderby ) ) {
  61. $args['orderby'] = $orderby;
  62. }
  63. if ( ! empty( $order ) ) {
  64. $args['order'] = $order;
  65. }
  66. $this->items = get_bookmarks( $args );
  67. }
  68. /**
  69. */
  70. public function no_items() {
  71. _e( 'No links found.' );
  72. }
  73. /**
  74. * @return array
  75. */
  76. protected function get_bulk_actions() {
  77. $actions = array();
  78. $actions['delete'] = __( 'Delete' );
  79. return $actions;
  80. }
  81. /**
  82. * @global int $cat_id
  83. * @param string $which
  84. */
  85. protected function extra_tablenav( $which ) {
  86. global $cat_id;
  87. if ( 'top' !== $which ) {
  88. return;
  89. }
  90. ?>
  91. <div class="alignleft actions">
  92. <?php
  93. $dropdown_options = array(
  94. 'selected' => $cat_id,
  95. 'name' => 'cat_id',
  96. 'taxonomy' => 'link_category',
  97. 'show_option_all' => get_taxonomy( 'link_category' )->labels->all_items,
  98. 'hide_empty' => true,
  99. 'hierarchical' => 1,
  100. 'show_count' => 0,
  101. 'orderby' => 'name',
  102. );
  103. echo '<label class="screen-reader-text" for="cat_id">' . get_taxonomy( 'link_category' )->labels->filter_by_item . '</label>';
  104. wp_dropdown_categories( $dropdown_options );
  105. submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
  106. ?>
  107. </div>
  108. <?php
  109. }
  110. /**
  111. * @return array
  112. */
  113. public function get_columns() {
  114. return array(
  115. 'cb' => '<input type="checkbox" />',
  116. 'name' => _x( 'Name', 'link name' ),
  117. 'url' => __( 'URL' ),
  118. 'categories' => __( 'Categories' ),
  119. 'rel' => __( 'Relationship' ),
  120. 'visible' => __( 'Visible' ),
  121. 'rating' => __( 'Rating' ),
  122. );
  123. }
  124. /**
  125. * @return array
  126. */
  127. protected function get_sortable_columns() {
  128. return array(
  129. 'name' => 'name',
  130. 'url' => 'url',
  131. 'visible' => 'visible',
  132. 'rating' => 'rating',
  133. );
  134. }
  135. /**
  136. * Get the name of the default primary column.
  137. *
  138. * @since 4.3.0
  139. *
  140. * @return string Name of the default primary column, in this case, 'name'.
  141. */
  142. protected function get_default_primary_column_name() {
  143. return 'name';
  144. }
  145. /**
  146. * Handles the checkbox column output.
  147. *
  148. * @since 4.3.0
  149. *
  150. * @param object $link The current link object.
  151. */
  152. public function column_cb( $link ) {
  153. ?>
  154. <label class="screen-reader-text" for="cb-select-<?php echo $link->link_id; ?>">
  155. <?php
  156. /* translators: %s: Link name. */
  157. printf( __( 'Select %s' ), $link->link_name );
  158. ?>
  159. </label>
  160. <input type="checkbox" name="linkcheck[]" id="cb-select-<?php echo $link->link_id; ?>" value="<?php echo esc_attr( $link->link_id ); ?>" />
  161. <?php
  162. }
  163. /**
  164. * Handles the link name column output.
  165. *
  166. * @since 4.3.0
  167. *
  168. * @param object $link The current link object.
  169. */
  170. public function column_name( $link ) {
  171. $edit_link = get_edit_bookmark_link( $link );
  172. printf(
  173. '<strong><a class="row-title" href="%s" aria-label="%s">%s</a></strong>',
  174. $edit_link,
  175. /* translators: %s: Link name. */
  176. esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $link->link_name ) ),
  177. $link->link_name
  178. );
  179. }
  180. /**
  181. * Handles the link URL column output.
  182. *
  183. * @since 4.3.0
  184. *
  185. * @param object $link The current link object.
  186. */
  187. public function column_url( $link ) {
  188. $short_url = url_shorten( $link->link_url );
  189. echo "<a href='$link->link_url'>$short_url</a>";
  190. }
  191. /**
  192. * Handles the link categories column output.
  193. *
  194. * @since 4.3.0
  195. *
  196. * @global int $cat_id
  197. *
  198. * @param object $link The current link object.
  199. */
  200. public function column_categories( $link ) {
  201. global $cat_id;
  202. $cat_names = array();
  203. foreach ( $link->link_category as $category ) {
  204. $cat = get_term( $category, 'link_category', OBJECT, 'display' );
  205. if ( is_wp_error( $cat ) ) {
  206. echo $cat->get_error_message();
  207. }
  208. $cat_name = $cat->name;
  209. if ( (int) $cat_id !== $category ) {
  210. $cat_name = "<a href='link-manager.php?cat_id=$category'>$cat_name</a>";
  211. }
  212. $cat_names[] = $cat_name;
  213. }
  214. echo implode( ', ', $cat_names );
  215. }
  216. /**
  217. * Handles the link relation column output.
  218. *
  219. * @since 4.3.0
  220. *
  221. * @param object $link The current link object.
  222. */
  223. public function column_rel( $link ) {
  224. echo empty( $link->link_rel ) ? '<br />' : $link->link_rel;
  225. }
  226. /**
  227. * Handles the link visibility column output.
  228. *
  229. * @since 4.3.0
  230. *
  231. * @param object $link The current link object.
  232. */
  233. public function column_visible( $link ) {
  234. if ( 'Y' === $link->link_visible ) {
  235. _e( 'Yes' );
  236. } else {
  237. _e( 'No' );
  238. }
  239. }
  240. /**
  241. * Handles the link rating column output.
  242. *
  243. * @since 4.3.0
  244. *
  245. * @param object $link The current link object.
  246. */
  247. public function column_rating( $link ) {
  248. echo $link->link_rating;
  249. }
  250. /**
  251. * Handles the default column output.
  252. *
  253. * @since 4.3.0
  254. *
  255. * @param object $link Link object.
  256. * @param string $column_name Current column name.
  257. */
  258. public function column_default( $link, $column_name ) {
  259. /**
  260. * Fires for each registered custom link column.
  261. *
  262. * @since 2.1.0
  263. *
  264. * @param string $column_name Name of the custom column.
  265. * @param int $link_id Link ID.
  266. */
  267. do_action( 'manage_link_custom_column', $column_name, $link->link_id );
  268. }
  269. public function display_rows() {
  270. foreach ( $this->items as $link ) {
  271. $link = sanitize_bookmark( $link );
  272. $link->link_name = esc_attr( $link->link_name );
  273. $link->link_category = wp_get_link_cats( $link->link_id );
  274. ?>
  275. <tr id="link-<?php echo $link->link_id; ?>">
  276. <?php $this->single_row_columns( $link ); ?>
  277. </tr>
  278. <?php
  279. }
  280. }
  281. /**
  282. * Generates and displays row action links.
  283. *
  284. * @since 4.3.0
  285. *
  286. * @param object $link Link being acted upon.
  287. * @param string $column_name Current column name.
  288. * @param string $primary Primary column name.
  289. * @return string Row actions output for links, or an empty string
  290. * if the current column is not the primary column.
  291. */
  292. protected function handle_row_actions( $link, $column_name, $primary ) {
  293. if ( $primary !== $column_name ) {
  294. return '';
  295. }
  296. $edit_link = get_edit_bookmark_link( $link );
  297. $actions = array();
  298. $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>';
  299. $actions['delete'] = sprintf(
  300. '<a class="submitdelete" href="%s" onclick="return confirm( \'%s\' );">%s</a>',
  301. wp_nonce_url( "link.php?action=delete&amp;link_id=$link->link_id", 'delete-bookmark_' . $link->link_id ),
  302. /* translators: %s: Link name. */
  303. esc_js( sprintf( __( "You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete." ), $link->link_name ) ),
  304. __( 'Delete' )
  305. );
  306. return $this->row_actions( $actions );
  307. }
  308. }