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