author | ymh <ymh.work@gmail.com> |
Wed, 21 Sep 2022 18:19:35 +0200 | |
changeset 18 | be944660c56a |
parent 16 | a86126ab1dd4 |
child 19 | 3d72ae0968f4 |
permissions | -rw-r--r-- |
0 | 1 |
<?php |
2 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
3 |
* List Table API: WP_Terms_List_Table class |
0 | 4 |
* |
5 |
* @package WordPress |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
6 |
* @subpackage Administration |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
7 |
* @since 3.1.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
8 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
9 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
10 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
11 |
* Core class used to implement displaying terms in a list table. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
12 |
* |
0 | 13 |
* @since 3.1.0 |
14 |
* @access private |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
15 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
16 |
* @see WP_List_Table |
0 | 17 |
*/ |
18 |
class WP_Terms_List_Table extends WP_List_Table { |
|
19 |
||
5 | 20 |
public $callback_args; |
21 |
||
22 |
private $level; |
|
0 | 23 |
|
5 | 24 |
/** |
25 |
* Constructor. |
|
26 |
* |
|
27 |
* @since 3.1.0 |
|
28 |
* |
|
29 |
* @see WP_List_Table::__construct() for more information on default arguments. |
|
30 |
* |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
31 |
* @global string $post_type |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
32 |
* @global string $taxonomy |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
33 |
* @global string $action |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
34 |
* @global object $tax |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
35 |
* |
5 | 36 |
* @param array $args An associative array of arguments. |
37 |
*/ |
|
38 |
public function __construct( $args = array() ) { |
|
0 | 39 |
global $post_type, $taxonomy, $action, $tax; |
40 |
||
9 | 41 |
parent::__construct( |
42 |
array( |
|
43 |
'plural' => 'tags', |
|
44 |
'singular' => 'tag', |
|
45 |
'screen' => isset( $args['screen'] ) ? $args['screen'] : null, |
|
46 |
) |
|
47 |
); |
|
0 | 48 |
|
49 |
$action = $this->screen->action; |
|
50 |
$post_type = $this->screen->post_type; |
|
51 |
$taxonomy = $this->screen->taxonomy; |
|
52 |
||
9 | 53 |
if ( empty( $taxonomy ) ) { |
0 | 54 |
$taxonomy = 'post_tag'; |
9 | 55 |
} |
0 | 56 |
|
9 | 57 |
if ( ! taxonomy_exists( $taxonomy ) ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
58 |
wp_die( __( 'Invalid taxonomy.' ) ); |
9 | 59 |
} |
0 | 60 |
|
61 |
$tax = get_taxonomy( $taxonomy ); |
|
62 |
||
63 |
// @todo Still needed? Maybe just the show_ui part. |
|
16 | 64 |
if ( empty( $post_type ) || ! in_array( $post_type, get_post_types( array( 'show_ui' => true ) ), true ) ) { |
0 | 65 |
$post_type = 'post'; |
9 | 66 |
} |
0 | 67 |
|
68 |
} |
|
69 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
70 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
71 |
* @return bool |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
72 |
*/ |
5 | 73 |
public function ajax_user_can() { |
0 | 74 |
return current_user_can( get_taxonomy( $this->screen->taxonomy )->cap->manage_terms ); |
75 |
} |
|
76 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
77 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
78 |
*/ |
5 | 79 |
public function prepare_items() { |
0 | 80 |
$tags_per_page = $this->get_items_per_page( 'edit_' . $this->screen->taxonomy . '_per_page' ); |
81 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
82 |
if ( 'post_tag' === $this->screen->taxonomy ) { |
5 | 83 |
/** |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
84 |
* Filters the number of terms displayed per page for the Tags list table. |
5 | 85 |
* |
86 |
* @since 2.8.0 |
|
87 |
* |
|
88 |
* @param int $tags_per_page Number of tags to be displayed. Default 20. |
|
89 |
*/ |
|
0 | 90 |
$tags_per_page = apply_filters( 'edit_tags_per_page', $tags_per_page ); |
5 | 91 |
|
92 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
93 |
* Filters the number of terms displayed per page for the Tags list table. |
5 | 94 |
* |
95 |
* @since 2.7.0 |
|
16 | 96 |
* @deprecated 2.8.0 Use {@see 'edit_tags_per_page'} instead. |
5 | 97 |
* |
98 |
* @param int $tags_per_page Number of tags to be displayed. Default 20. |
|
99 |
*/ |
|
16 | 100 |
$tags_per_page = apply_filters_deprecated( 'tagsperpage', array( $tags_per_page ), '2.8.0', 'edit_tags_per_page' ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
101 |
} elseif ( 'category' === $this->screen->taxonomy ) { |
5 | 102 |
/** |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
103 |
* Filters the number of terms displayed per page for the Categories list table. |
5 | 104 |
* |
105 |
* @since 2.8.0 |
|
106 |
* |
|
107 |
* @param int $tags_per_page Number of categories to be displayed. Default 20. |
|
108 |
*/ |
|
109 |
$tags_per_page = apply_filters( 'edit_categories_per_page', $tags_per_page ); |
|
0 | 110 |
} |
111 |
||
9 | 112 |
$search = ! empty( $_REQUEST['s'] ) ? trim( wp_unslash( $_REQUEST['s'] ) ) : ''; |
0 | 113 |
|
114 |
$args = array( |
|
115 |
'search' => $search, |
|
9 | 116 |
'page' => $this->get_pagenum(), |
0 | 117 |
'number' => $tags_per_page, |
118 |
); |
|
119 |
||
9 | 120 |
if ( ! empty( $_REQUEST['orderby'] ) ) { |
0 | 121 |
$args['orderby'] = trim( wp_unslash( $_REQUEST['orderby'] ) ); |
9 | 122 |
} |
0 | 123 |
|
9 | 124 |
if ( ! empty( $_REQUEST['order'] ) ) { |
0 | 125 |
$args['order'] = trim( wp_unslash( $_REQUEST['order'] ) ); |
9 | 126 |
} |
0 | 127 |
|
128 |
$this->callback_args = $args; |
|
129 |
||
9 | 130 |
$this->set_pagination_args( |
131 |
array( |
|
18 | 132 |
'total_items' => wp_count_terms( |
133 |
array( |
|
134 |
'taxonomy' => $this->screen->taxonomy, |
|
135 |
'search' => $search, |
|
136 |
) |
|
137 |
), |
|
9 | 138 |
'per_page' => $tags_per_page, |
139 |
) |
|
140 |
); |
|
0 | 141 |
} |
142 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
143 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
144 |
* @return bool |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
145 |
*/ |
5 | 146 |
public function has_items() { |
16 | 147 |
// @todo Populate $this->items in prepare_items(). |
0 | 148 |
return true; |
149 |
} |
|
150 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
151 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
152 |
*/ |
5 | 153 |
public function no_items() { |
154 |
echo get_taxonomy( $this->screen->taxonomy )->labels->not_found; |
|
155 |
} |
|
156 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
157 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
158 |
* @return array |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
159 |
*/ |
5 | 160 |
protected function get_bulk_actions() { |
0 | 161 |
$actions = array(); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
162 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
163 |
if ( current_user_can( get_taxonomy( $this->screen->taxonomy )->cap->delete_terms ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
164 |
$actions['delete'] = __( 'Delete' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
165 |
} |
0 | 166 |
|
167 |
return $actions; |
|
168 |
} |
|
169 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
170 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
171 |
* @return string |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
172 |
*/ |
5 | 173 |
public function current_action() { |
18 | 174 |
if ( isset( $_REQUEST['action'] ) && isset( $_REQUEST['delete_tags'] ) && 'delete' === $_REQUEST['action'] ) { |
0 | 175 |
return 'bulk-delete'; |
9 | 176 |
} |
0 | 177 |
|
178 |
return parent::current_action(); |
|
179 |
} |
|
180 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
181 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
182 |
* @return array |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
183 |
*/ |
5 | 184 |
public function get_columns() { |
0 | 185 |
$columns = array( |
186 |
'cb' => '<input type="checkbox" />', |
|
187 |
'name' => _x( 'Name', 'term name' ), |
|
188 |
'description' => __( 'Description' ), |
|
189 |
'slug' => __( 'Slug' ), |
|
190 |
); |
|
191 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
192 |
if ( 'link_category' === $this->screen->taxonomy ) { |
0 | 193 |
$columns['links'] = __( 'Links' ); |
194 |
} else { |
|
5 | 195 |
$columns['posts'] = _x( 'Count', 'Number/count of items' ); |
0 | 196 |
} |
197 |
||
198 |
return $columns; |
|
199 |
} |
|
200 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
201 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
202 |
* @return array |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
203 |
*/ |
5 | 204 |
protected function get_sortable_columns() { |
0 | 205 |
return array( |
206 |
'name' => 'name', |
|
207 |
'description' => 'description', |
|
208 |
'slug' => 'slug', |
|
209 |
'posts' => 'count', |
|
9 | 210 |
'links' => 'count', |
0 | 211 |
); |
212 |
} |
|
213 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
214 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
215 |
*/ |
5 | 216 |
public function display_rows_or_placeholder() { |
0 | 217 |
$taxonomy = $this->screen->taxonomy; |
218 |
||
9 | 219 |
$args = wp_parse_args( |
220 |
$this->callback_args, |
|
221 |
array( |
|
16 | 222 |
'taxonomy' => $taxonomy, |
9 | 223 |
'page' => 1, |
224 |
'number' => 20, |
|
225 |
'search' => '', |
|
226 |
'hide_empty' => 0, |
|
227 |
) |
|
228 |
); |
|
0 | 229 |
|
5 | 230 |
$page = $args['page']; |
231 |
||
232 |
// Set variable because $args['number'] can be subsequently overridden. |
|
233 |
$number = $args['number']; |
|
0 | 234 |
|
16 | 235 |
$offset = ( $page - 1 ) * $number; |
236 |
$args['offset'] = $offset; |
|
0 | 237 |
|
5 | 238 |
// Convert it to table rows. |
0 | 239 |
$count = 0; |
240 |
||
5 | 241 |
if ( is_taxonomy_hierarchical( $taxonomy ) && ! isset( $args['orderby'] ) ) { |
0 | 242 |
// We'll need the full set of terms then. |
16 | 243 |
$args['number'] = 0; |
244 |
$args['offset'] = $args['number']; |
|
0 | 245 |
} |
16 | 246 |
|
247 |
$terms = get_terms( $args ); |
|
0 | 248 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
249 |
if ( empty( $terms ) || ! is_array( $terms ) ) { |
0 | 250 |
echo '<tr class="no-items"><td class="colspanchange" colspan="' . $this->get_column_count() . '">'; |
251 |
$this->no_items(); |
|
252 |
echo '</td></tr>'; |
|
253 |
return; |
|
254 |
} |
|
255 |
||
5 | 256 |
if ( is_taxonomy_hierarchical( $taxonomy ) && ! isset( $args['orderby'] ) ) { |
257 |
if ( ! empty( $args['search'] ) ) {// Ignore children on searches. |
|
0 | 258 |
$children = array(); |
5 | 259 |
} else { |
0 | 260 |
$children = _get_term_hierarchy( $taxonomy ); |
5 | 261 |
} |
16 | 262 |
|
263 |
/* |
|
264 |
* Some funky recursion to get the job done (paging & parents mainly) is contained within. |
|
265 |
* Skip it for non-hierarchical taxonomies for performance sake. |
|
266 |
*/ |
|
0 | 267 |
$this->_rows( $taxonomy, $terms, $children, $offset, $number, $count ); |
268 |
} else { |
|
5 | 269 |
foreach ( $terms as $term ) { |
0 | 270 |
$this->single_row( $term ); |
5 | 271 |
} |
0 | 272 |
} |
273 |
} |
|
274 |
||
5 | 275 |
/** |
276 |
* @param string $taxonomy |
|
16 | 277 |
* @param array $terms |
278 |
* @param array $children |
|
279 |
* @param int $start |
|
280 |
* @param int $per_page |
|
281 |
* @param int $count |
|
282 |
* @param int $parent |
|
283 |
* @param int $level |
|
5 | 284 |
*/ |
285 |
private function _rows( $taxonomy, $terms, &$children, $start, $per_page, &$count, $parent = 0, $level = 0 ) { |
|
0 | 286 |
|
287 |
$end = $start + $per_page; |
|
288 |
||
289 |
foreach ( $terms as $key => $term ) { |
|
290 |
||
9 | 291 |
if ( $count >= $end ) { |
0 | 292 |
break; |
9 | 293 |
} |
0 | 294 |
|
18 | 295 |
if ( $term->parent !== $parent && empty( $_REQUEST['s'] ) ) { |
0 | 296 |
continue; |
9 | 297 |
} |
0 | 298 |
|
299 |
// If the page starts in a subtree, print the parents. |
|
18 | 300 |
if ( $count === $start && $term->parent > 0 && empty( $_REQUEST['s'] ) ) { |
16 | 301 |
$my_parents = array(); |
302 |
$parent_ids = array(); |
|
9 | 303 |
$p = $term->parent; |
18 | 304 |
|
0 | 305 |
while ( $p ) { |
9 | 306 |
$my_parent = get_term( $p, $taxonomy ); |
0 | 307 |
$my_parents[] = $my_parent; |
9 | 308 |
$p = $my_parent->parent; |
18 | 309 |
|
16 | 310 |
if ( in_array( $p, $parent_ids, true ) ) { // Prevent parent loops. |
0 | 311 |
break; |
9 | 312 |
} |
18 | 313 |
|
0 | 314 |
$parent_ids[] = $p; |
315 |
} |
|
18 | 316 |
|
0 | 317 |
unset( $parent_ids ); |
318 |
||
319 |
$num_parents = count( $my_parents ); |
|
18 | 320 |
|
0 | 321 |
while ( $my_parent = array_pop( $my_parents ) ) { |
322 |
echo "\t"; |
|
323 |
$this->single_row( $my_parent, $level - $num_parents ); |
|
324 |
$num_parents--; |
|
325 |
} |
|
326 |
} |
|
327 |
||
328 |
if ( $count >= $start ) { |
|
329 |
echo "\t"; |
|
330 |
$this->single_row( $term, $level ); |
|
331 |
} |
|
332 |
||
333 |
++$count; |
|
334 |
||
9 | 335 |
unset( $terms[ $key ] ); |
0 | 336 |
|
9 | 337 |
if ( isset( $children[ $term->term_id ] ) && empty( $_REQUEST['s'] ) ) { |
0 | 338 |
$this->_rows( $taxonomy, $terms, $children, $start, $per_page, $count, $term->term_id, $level + 1 ); |
9 | 339 |
} |
0 | 340 |
} |
341 |
} |
|
342 |
||
5 | 343 |
/** |
344 |
* @global string $taxonomy |
|
16 | 345 |
* @param WP_Term $tag Term object. |
346 |
* @param int $level |
|
5 | 347 |
*/ |
348 |
public function single_row( $tag, $level = 0 ) { |
|
349 |
global $taxonomy; |
|
9 | 350 |
$tag = sanitize_term( $tag, $taxonomy ); |
0 | 351 |
|
352 |
$this->level = $level; |
|
353 |
||
9 | 354 |
if ( $tag->parent ) { |
355 |
$count = count( get_ancestors( $tag->term_id, $taxonomy, 'taxonomy' ) ); |
|
356 |
$level = 'level-' . $count; |
|
357 |
} else { |
|
358 |
$level = 'level-0'; |
|
359 |
} |
|
360 |
||
361 |
echo '<tr id="tag-' . $tag->term_id . '" class="' . $level . '">'; |
|
0 | 362 |
$this->single_row_columns( $tag ); |
363 |
echo '</tr>'; |
|
364 |
} |
|
365 |
||
5 | 366 |
/** |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
367 |
* @param WP_Term $tag Term object. |
5 | 368 |
* @return string |
369 |
*/ |
|
370 |
public function column_cb( $tag ) { |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
371 |
if ( current_user_can( 'delete_term', $tag->term_id ) ) { |
16 | 372 |
return sprintf( |
373 |
'<label class="screen-reader-text" for="cb-select-%1$s">%2$s</label>' . |
|
374 |
'<input type="checkbox" name="delete_tags[]" value="%1$s" id="cb-select-%1$s" />', |
|
375 |
$tag->term_id, |
|
376 |
/* translators: %s: Taxonomy term name. */ |
|
377 |
sprintf( __( 'Select %s' ), $tag->name ) |
|
378 |
); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
379 |
} |
0 | 380 |
|
381 |
return ' '; |
|
382 |
} |
|
383 |
||
5 | 384 |
/** |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
385 |
* @param WP_Term $tag Term object. |
5 | 386 |
* @return string |
387 |
*/ |
|
388 |
public function column_name( $tag ) { |
|
0 | 389 |
$taxonomy = $this->screen->taxonomy; |
390 |
||
391 |
$pad = str_repeat( '— ', max( 0, $this->level ) ); |
|
5 | 392 |
|
393 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
394 |
* Filters display of the term name in the terms list table. |
5 | 395 |
* |
396 |
* The default output may include padding due to the term's |
|
397 |
* current level in the term hierarchy. |
|
398 |
* |
|
399 |
* @since 2.5.0 |
|
400 |
* |
|
401 |
* @see WP_Terms_List_Table::column_name() |
|
402 |
* |
|
403 |
* @param string $pad_tag_name The term name, padded if not top-level. |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
404 |
* @param WP_Term $tag Term object. |
5 | 405 |
*/ |
0 | 406 |
$name = apply_filters( 'term_name', $pad . ' ' . $tag->name, $tag ); |
5 | 407 |
|
0 | 408 |
$qe_data = get_term( $tag->term_id, $taxonomy, OBJECT, 'edit' ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
409 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
410 |
$uri = wp_doing_ajax() ? wp_get_referer() : $_SERVER['REQUEST_URI']; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
411 |
|
9 | 412 |
$edit_link = get_edit_term_link( $tag->term_id, $taxonomy, $this->screen->post_type ); |
413 |
||
414 |
if ( $edit_link ) { |
|
415 |
$edit_link = add_query_arg( |
|
416 |
'wp_http_referer', |
|
417 |
urlencode( wp_unslash( $uri ) ), |
|
418 |
$edit_link |
|
419 |
); |
|
420 |
$name = sprintf( |
|
421 |
'<a class="row-title" href="%s" aria-label="%s">%s</a>', |
|
422 |
esc_url( $edit_link ), |
|
16 | 423 |
/* translators: %s: Taxonomy term name. */ |
9 | 424 |
esc_attr( sprintf( __( '“%s” (Edit)' ), $tag->name ) ), |
425 |
$name |
|
426 |
); |
|
427 |
} |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
428 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
429 |
$out = sprintf( |
9 | 430 |
'<strong>%s</strong><br />', |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
431 |
$name |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
432 |
); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
433 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
434 |
$out .= '<div class="hidden" id="inline_' . $qe_data->term_id . '">'; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
435 |
$out .= '<div class="name">' . $qe_data->name . '</div>'; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
436 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
437 |
/** This filter is documented in wp-admin/edit-tag-form.php */ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
438 |
$out .= '<div class="slug">' . apply_filters( 'editable_slug', $qe_data->slug, $qe_data ) . '</div>'; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
439 |
$out .= '<div class="parent">' . $qe_data->parent . '</div></div>'; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
440 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
441 |
return $out; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
442 |
} |
0 | 443 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
444 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
445 |
* Gets the name of the default primary column. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
446 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
447 |
* @since 4.3.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
448 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
449 |
* @return string Name of the default primary column, in this case, 'name'. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
450 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
451 |
protected function get_default_primary_column_name() { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
452 |
return 'name'; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
453 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
454 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
455 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
456 |
* Generates and displays row action links. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
457 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
458 |
* @since 4.3.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
459 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
460 |
* @param WP_Term $tag Tag being acted upon. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
461 |
* @param string $column_name Current column name. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
462 |
* @param string $primary Primary column name. |
16 | 463 |
* @return string Row actions output for terms, or an empty string |
464 |
* if the current column is not the primary column. |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
465 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
466 |
protected function handle_row_actions( $tag, $column_name, $primary ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
467 |
if ( $primary !== $column_name ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
468 |
return ''; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
469 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
470 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
471 |
$taxonomy = $this->screen->taxonomy; |
9 | 472 |
$tax = get_taxonomy( $taxonomy ); |
473 |
$uri = wp_doing_ajax() ? wp_get_referer() : $_SERVER['REQUEST_URI']; |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
474 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
475 |
$edit_link = add_query_arg( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
476 |
'wp_http_referer', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
477 |
urlencode( wp_unslash( $uri ) ), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
478 |
get_edit_term_link( $tag->term_id, $taxonomy, $this->screen->post_type ) |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
479 |
); |
0 | 480 |
|
481 |
$actions = array(); |
|
18 | 482 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
483 |
if ( current_user_can( 'edit_term', $tag->term_id ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
484 |
$actions['edit'] = sprintf( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
485 |
'<a href="%s" aria-label="%s">%s</a>', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
486 |
esc_url( $edit_link ), |
16 | 487 |
/* translators: %s: Taxonomy term name. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
488 |
esc_attr( sprintf( __( 'Edit “%s”' ), $tag->name ) ), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
489 |
__( 'Edit' ) |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
490 |
); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
491 |
$actions['inline hide-if-no-js'] = sprintf( |
9 | 492 |
'<button type="button" class="button-link editinline" aria-label="%s" aria-expanded="false">%s</button>', |
16 | 493 |
/* translators: %s: Taxonomy term name. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
494 |
esc_attr( sprintf( __( 'Quick edit “%s” inline' ), $tag->name ) ), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
495 |
__( 'Quick Edit' ) |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
496 |
); |
0 | 497 |
} |
18 | 498 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
499 |
if ( current_user_can( 'delete_term', $tag->term_id ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
500 |
$actions['delete'] = sprintf( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
501 |
'<a href="%s" class="delete-tag aria-button-if-js" aria-label="%s">%s</a>', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
502 |
wp_nonce_url( "edit-tags.php?action=delete&taxonomy=$taxonomy&tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id ), |
16 | 503 |
/* translators: %s: Taxonomy term name. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
504 |
esc_attr( sprintf( __( 'Delete “%s”' ), $tag->name ) ), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
505 |
__( 'Delete' ) |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
506 |
); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
507 |
} |
18 | 508 |
|
9 | 509 |
if ( is_taxonomy_viewable( $tax ) ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
510 |
$actions['view'] = sprintf( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
511 |
'<a href="%s" aria-label="%s">%s</a>', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
512 |
get_term_link( $tag ), |
16 | 513 |
/* translators: %s: Taxonomy term name. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
514 |
esc_attr( sprintf( __( 'View “%s” archive' ), $tag->name ) ), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
515 |
__( 'View' ) |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
516 |
); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
517 |
} |
0 | 518 |
|
5 | 519 |
/** |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
520 |
* Filters the action links displayed for each term in the Tags list table. |
5 | 521 |
* |
522 |
* @since 2.8.0 |
|
16 | 523 |
* @since 3.0.0 Deprecated in favor of {@see '{$taxonomy}_row_actions'} filter. |
524 |
* @since 5.4.2 Restored (un-deprecated). |
|
5 | 525 |
* |
9 | 526 |
* @param string[] $actions An array of action links to be displayed. Default |
527 |
* 'Edit', 'Quick Edit', 'Delete', and 'View'. |
|
528 |
* @param WP_Term $tag Term object. |
|
5 | 529 |
*/ |
0 | 530 |
$actions = apply_filters( 'tag_row_actions', $actions, $tag ); |
5 | 531 |
|
532 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
533 |
* Filters the action links displayed for each term in the terms list table. |
5 | 534 |
* |
535 |
* The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug. |
|
536 |
* |
|
18 | 537 |
* Possible hook names include: |
538 |
* |
|
539 |
* - `category_row_actions` |
|
540 |
* - `post_tag_row_actions` |
|
541 |
* |
|
5 | 542 |
* @since 3.0.0 |
543 |
* |
|
9 | 544 |
* @param string[] $actions An array of action links to be displayed. Default |
545 |
* 'Edit', 'Quick Edit', 'Delete', and 'View'. |
|
546 |
* @param WP_Term $tag Term object. |
|
5 | 547 |
*/ |
0 | 548 |
$actions = apply_filters( "{$taxonomy}_row_actions", $actions, $tag ); |
549 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
550 |
return $this->row_actions( $actions ); |
0 | 551 |
} |
552 |
||
5 | 553 |
/** |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
554 |
* @param WP_Term $tag Term object. |
5 | 555 |
* @return string |
556 |
*/ |
|
557 |
public function column_description( $tag ) { |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
558 |
if ( $tag->description ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
559 |
return $tag->description; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
560 |
} else { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
561 |
return '<span aria-hidden="true">—</span><span class="screen-reader-text">' . __( 'No description' ) . '</span>'; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
562 |
} |
0 | 563 |
} |
564 |
||
5 | 565 |
/** |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
566 |
* @param WP_Term $tag Term object. |
5 | 567 |
* @return string |
568 |
*/ |
|
569 |
public function column_slug( $tag ) { |
|
570 |
/** This filter is documented in wp-admin/edit-tag-form.php */ |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
571 |
return apply_filters( 'editable_slug', $tag->slug, $tag ); |
0 | 572 |
} |
573 |
||
5 | 574 |
/** |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
575 |
* @param WP_Term $tag Term object. |
5 | 576 |
* @return string |
577 |
*/ |
|
578 |
public function column_posts( $tag ) { |
|
0 | 579 |
$count = number_format_i18n( $tag->count ); |
580 |
||
581 |
$tax = get_taxonomy( $this->screen->taxonomy ); |
|
582 |
||
583 |
$ptype_object = get_post_type_object( $this->screen->post_type ); |
|
9 | 584 |
if ( ! $ptype_object->show_ui ) { |
0 | 585 |
return $count; |
9 | 586 |
} |
0 | 587 |
|
588 |
if ( $tax->query_var ) { |
|
589 |
$args = array( $tax->query_var => $tag->slug ); |
|
590 |
} else { |
|
9 | 591 |
$args = array( |
592 |
'taxonomy' => $tax->name, |
|
593 |
'term' => $tag->slug, |
|
594 |
); |
|
0 | 595 |
} |
596 |
||
16 | 597 |
if ( 'post' !== $this->screen->post_type ) { |
0 | 598 |
$args['post_type'] = $this->screen->post_type; |
9 | 599 |
} |
0 | 600 |
|
9 | 601 |
if ( 'attachment' === $this->screen->post_type ) { |
602 |
return "<a href='" . esc_url( add_query_arg( $args, 'upload.php' ) ) . "'>$count</a>"; |
|
603 |
} |
|
0 | 604 |
|
9 | 605 |
return "<a href='" . esc_url( add_query_arg( $args, 'edit.php' ) ) . "'>$count</a>"; |
0 | 606 |
} |
607 |
||
5 | 608 |
/** |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
609 |
* @param WP_Term $tag Term object. |
5 | 610 |
* @return string |
611 |
*/ |
|
612 |
public function column_links( $tag ) { |
|
0 | 613 |
$count = number_format_i18n( $tag->count ); |
18 | 614 |
|
9 | 615 |
if ( $count ) { |
0 | 616 |
$count = "<a href='link-manager.php?cat_id=$tag->term_id'>$count</a>"; |
9 | 617 |
} |
18 | 618 |
|
0 | 619 |
return $count; |
620 |
} |
|
621 |
||
5 | 622 |
/** |
16 | 623 |
* @param WP_Term $tag Term object. |
624 |
* @param string $column_name Name of the column. |
|
5 | 625 |
* @return string |
626 |
*/ |
|
627 |
public function column_default( $tag, $column_name ) { |
|
628 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
629 |
* Filters the displayed columns in the terms list table. |
5 | 630 |
* |
631 |
* The dynamic portion of the hook name, `$this->screen->taxonomy`, |
|
632 |
* refers to the slug of the current taxonomy. |
|
633 |
* |
|
18 | 634 |
* Possible hook names include: |
635 |
* |
|
636 |
* - `manage_category_custom_column` |
|
637 |
* - `manage_post_tag_custom_column` |
|
638 |
* |
|
5 | 639 |
* @since 2.8.0 |
640 |
* |
|
641 |
* @param string $string Blank string. |
|
642 |
* @param string $column_name Name of the column. |
|
643 |
* @param int $term_id Term ID. |
|
644 |
*/ |
|
0 | 645 |
return apply_filters( "manage_{$this->screen->taxonomy}_custom_column", '', $column_name, $tag->term_id ); |
646 |
} |
|
647 |
||
648 |
/** |
|
649 |
* Outputs the hidden row displayed when inline editing |
|
650 |
* |
|
651 |
* @since 3.1.0 |
|
652 |
*/ |
|
5 | 653 |
public function inline_edit() { |
0 | 654 |
$tax = get_taxonomy( $this->screen->taxonomy ); |
655 |
||
9 | 656 |
if ( ! current_user_can( $tax->cap->edit_terms ) ) { |
0 | 657 |
return; |
9 | 658 |
} |
659 |
?> |
|
0 | 660 |
|
16 | 661 |
<form method="get"> |
662 |
<table style="display: none"><tbody id="inlineedit"> |
|
663 |
||
664 |
<tr id="inline-edit" class="inline-edit-row" style="display: none"> |
|
665 |
<td colspan="<?php echo $this->get_column_count(); ?>" class="colspanchange"> |
|
0 | 666 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
667 |
<fieldset> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
668 |
<legend class="inline-edit-legend"><?php _e( 'Quick Edit' ); ?></legend> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
669 |
<div class="inline-edit-col"> |
0 | 670 |
<label> |
671 |
<span class="title"><?php _ex( 'Name', 'term name' ); ?></span> |
|
672 |
<span class="input-text-wrap"><input type="text" name="name" class="ptitle" value="" /></span> |
|
673 |
</label> |
|
16 | 674 |
|
675 |
<?php if ( ! global_terms_enabled() ) : ?> |
|
676 |
<label> |
|
677 |
<span class="title"><?php _e( 'Slug' ); ?></span> |
|
678 |
<span class="input-text-wrap"><input type="text" name="slug" class="ptitle" value="" /></span> |
|
679 |
</label> |
|
680 |
<?php endif; ?> |
|
681 |
</div> |
|
682 |
</fieldset> |
|
0 | 683 |
|
16 | 684 |
<?php |
685 |
$core_columns = array( |
|
686 |
'cb' => true, |
|
687 |
'description' => true, |
|
688 |
'name' => true, |
|
689 |
'slug' => true, |
|
690 |
'posts' => true, |
|
691 |
); |
|
0 | 692 |
|
16 | 693 |
list( $columns ) = $this->get_column_info(); |
0 | 694 |
|
16 | 695 |
foreach ( $columns as $column_name => $column_display_name ) { |
696 |
if ( isset( $core_columns[ $column_name ] ) ) { |
|
697 |
continue; |
|
698 |
} |
|
0 | 699 |
|
16 | 700 |
/** This action is documented in wp-admin/includes/class-wp-posts-list-table.php */ |
701 |
do_action( 'quick_edit_custom_box', $column_name, 'edit-tags', $this->screen->taxonomy ); |
|
702 |
} |
|
703 |
?> |
|
0 | 704 |
|
16 | 705 |
<div class="inline-edit-save submit"> |
706 |
<button type="button" class="cancel button alignleft"><?php _e( 'Cancel' ); ?></button> |
|
707 |
<button type="button" class="save button button-primary alignright"><?php echo $tax->labels->update_item; ?></button> |
|
708 |
<span class="spinner"></span> |
|
0 | 709 |
|
16 | 710 |
<?php wp_nonce_field( 'taxinlineeditnonce', '_inline_edit', false ); ?> |
711 |
<input type="hidden" name="taxonomy" value="<?php echo esc_attr( $this->screen->taxonomy ); ?>" /> |
|
712 |
<input type="hidden" name="post_type" value="<?php echo esc_attr( $this->screen->post_type ); ?>" /> |
|
713 |
<br class="clear" /> |
|
714 |
||
715 |
<div class="notice notice-error notice-alt inline hidden"> |
|
716 |
<p class="error"></p> |
|
717 |
</div> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
718 |
</div> |
16 | 719 |
|
720 |
</td></tr> |
|
721 |
||
722 |
</tbody></table> |
|
723 |
</form> |
|
9 | 724 |
<?php |
0 | 725 |
} |
726 |
} |