Issues (4967)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

src/wp-admin/edit-tags.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/**
3
 * Edit Tags Administration Screen.
4
 *
5
 * @package WordPress
6
 * @subpackage Administration
7
 */
8
9
/** WordPress Administration Bootstrap */
10
require_once( dirname( __FILE__ ) . '/admin.php' );
11
12
if ( ! $taxnow )
13
	wp_die( __( 'Invalid taxonomy.' ) );
14
15
$tax = get_taxonomy( $taxnow );
16
17
if ( ! $tax )
18
	wp_die( __( 'Invalid taxonomy.' ) );
19
20 View Code Duplication
if ( ! in_array( $tax->name, get_taxonomies( array( 'show_ui' => true ) ) ) ) {
21
   wp_die( __( 'Sorry, you are not allowed to edit terms in this taxonomy.' ) );
22
}
23
24 View Code Duplication
if ( ! current_user_can( $tax->cap->manage_terms ) ) {
25
	wp_die(
26
		'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
27
		'<p>' . __( 'Sorry, you are not allowed to manage terms in this taxonomy.' ) . '</p>',
28
		403
29
	);
30
}
31
32
/**
33
 * $post_type is set when the WP_Terms_List_Table instance is created
34
 *
35
 * @global string $post_type
36
 */
37
global $post_type;
38
39
$wp_list_table = _get_list_table('WP_Terms_List_Table');
40
$pagenum = $wp_list_table->get_pagenum();
41
42
$title = $tax->labels->name;
43
44 View Code Duplication
if ( 'post' != $post_type ) {
45
	$parent_file = ( 'attachment' == $post_type ) ? 'upload.php' : "edit.php?post_type=$post_type";
46
	$submenu_file = "edit-tags.php?taxonomy=$taxonomy&amp;post_type=$post_type";
47
} elseif ( 'link_category' == $tax->name ) {
48
	$parent_file = 'link-manager.php';
49
	$submenu_file = 'edit-tags.php?taxonomy=link_category';
50
} else {
51
	$parent_file = 'edit.php';
52
	$submenu_file = "edit-tags.php?taxonomy=$taxonomy";
53
}
54
55
add_screen_option( 'per_page', array( 'default' => 20, 'option' => 'edit_' . $tax->name . '_per_page' ) );
56
57
get_current_screen()->set_screen_reader_content( array(
58
	'heading_pagination' => $tax->labels->items_list_navigation,
59
	'heading_list'       => $tax->labels->items_list,
60
) );
61
62
$location = false;
63
$referer = wp_get_referer();
64
if ( ! $referer ) { // For POST requests.
65
	$referer = wp_unslash( $_SERVER['REQUEST_URI'] );
66
}
67
$referer = remove_query_arg( array( '_wp_http_referer', '_wpnonce', 'error', 'message', 'paged' ), $referer );
68
switch ( $wp_list_table->current_action() ) {
69
70
case 'add-tag':
71
	check_admin_referer( 'add-tag', '_wpnonce_add-tag' );
72
73 View Code Duplication
	if ( ! current_user_can( $tax->cap->edit_terms ) ) {
74
		wp_die(
75
			'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
76
			'<p>' . __( 'Sorry, you are not allowed to create terms in this taxonomy.' ) . '</p>',
77
			403
78
		);
79
	}
80
81
	$ret = wp_insert_term( $_POST['tag-name'], $taxonomy, $_POST );
82 View Code Duplication
	if ( $ret && !is_wp_error( $ret ) )
83
		$location = add_query_arg( 'message', 1, $referer );
84
	else
85
		$location = add_query_arg( array( 'error' => true, 'message' => 4 ), $referer );
86
87
	break;
88
89
case 'delete':
90
	if ( ! isset( $_REQUEST['tag_ID'] ) ) {
91
		break;
92
	}
93
94
	$tag_ID = (int) $_REQUEST['tag_ID'];
95
	check_admin_referer( 'delete-tag_' . $tag_ID );
96
97
	if ( ! current_user_can( 'delete_term', $tag_ID ) ) {
98
		wp_die(
99
			'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
100
			'<p>' . __( 'Sorry, you are not allowed to delete this item.' ) . '</p>',
101
			403
102
		);
103
	}
104
105
	wp_delete_term( $tag_ID, $taxonomy );
106
107
	$location = add_query_arg( 'message', 2, $referer );
108
109
	// When deleting a term, prevent the action from redirecting back to a term that no longer exists.
110
	$location = remove_query_arg( array( 'tag_ID', 'action' ), $location );
111
112
	break;
113
114
case 'bulk-delete':
115
	check_admin_referer( 'bulk-tags' );
116
117 View Code Duplication
	if ( ! current_user_can( $tax->cap->delete_terms ) ) {
118
		wp_die(
119
			'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
120
			'<p>' . __( 'Sorry, you are not allowed to delete these items.' ) . '</p>',
121
			403
122
		);
123
	}
124
125
	$tags = (array) $_REQUEST['delete_tags'];
126
	foreach ( $tags as $tag_ID ) {
127
		wp_delete_term( $tag_ID, $taxonomy );
128
	}
129
130
	$location = add_query_arg( 'message', 6, $referer );
131
132
	break;
133
134
case 'edit':
135
	if ( ! isset( $_REQUEST['tag_ID'] ) ) {
136
		break;
137
	}
138
139
	$term_id = (int) $_REQUEST['tag_ID'];
140
	$term    = get_term( $term_id );
141
142
	if ( ! $term instanceof WP_Term ) {
143
		wp_die( __( 'You attempted to edit an item that doesn&#8217;t exist. Perhaps it was deleted?' ) );
144
	}
145
146
	wp_redirect( esc_url_raw( get_edit_term_link( $term_id, $taxonomy, $post_type ) ) );
147
	exit;
148
149
case 'editedtag':
150
	$tag_ID = (int) $_POST['tag_ID'];
151
	check_admin_referer( 'update-tag_' . $tag_ID );
152
153
	if ( ! current_user_can( 'edit_term', $tag_ID ) ) {
154
		wp_die(
155
			'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
156
			'<p>' . __( 'Sorry, you are not allowed to edit this item.' ) . '</p>',
157
			403
158
		);
159
	}
160
161
	$tag = get_term( $tag_ID, $taxonomy );
162
	if ( ! $tag )
163
		wp_die( __( 'You attempted to edit an item that doesn&#8217;t exist. Perhaps it was deleted?' ) );
164
165
	$ret = wp_update_term( $tag_ID, $taxonomy, $_POST );
166
167 View Code Duplication
	if ( $ret && ! is_wp_error( $ret ) ) {
168
		$location = add_query_arg( 'message', 3, $referer );
169
	} else {
170
		$location = add_query_arg( array( 'error' => true, 'message' => 5 ), $referer );
171
	}
172
	break;
173
default:
174
	if ( ! $wp_list_table->current_action() || ! isset( $_REQUEST['delete_tags'] ) ) {
175
		break;
176
	}
177
	check_admin_referer( 'bulk-tags' );
178
	$tags = (array) $_REQUEST['delete_tags'];
179
	/** This action is documented in wp-admin/edit-comments.php */
180
	$location = apply_filters( 'handle_bulk_actions-' . get_current_screen()->id, $location, $wp_list_table->current_action(), $tags );
181
	break;
182
}
183
184
if ( ! $location && ! empty( $_REQUEST['_wp_http_referer'] ) ) {
185
	$location = remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) );
186
}
187
188
if ( $location ) {
189
	if ( $pagenum > 1 ) {
190
		$location = add_query_arg( 'paged', $pagenum, $location ); // $pagenum takes care of $total_pages.
191
	}
192
193
	/**
194
	 * Filters the taxonomy redirect destination URL.
195
	 *
196
	 * @since 4.6.0
197
	 *
198
	 * @param string $location The destination URL.
199
	 * @param object $tax      The taxonomy object.
200
	 */
201
	wp_redirect( apply_filters( 'redirect_term_location', $location, $tax ) );
202
	exit;
203
}
204
205
$wp_list_table->prepare_items();
206
$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
207
208
if ( $pagenum > $total_pages && $total_pages > 0 ) {
209
	wp_redirect( add_query_arg( 'paged', $total_pages ) );
210
	exit;
211
}
212
213
wp_enqueue_script('admin-tags');
214
if ( current_user_can($tax->cap->edit_terms) )
215
	wp_enqueue_script('inline-edit-tax');
216
217
if ( 'category' == $taxonomy || 'link_category' == $taxonomy || 'post_tag' == $taxonomy  ) {
218
	$help ='';
219
	if ( 'category' == $taxonomy )
220
		$help = '<p>' . sprintf(__( 'You can use categories to define sections of your site and group related posts. The default category is &#8220;Uncategorized&#8221; until you change it in your <a href="%s">writing settings</a>.' ) , 'options-writing.php' ) . '</p>';
221
	elseif ( 'link_category' == $taxonomy )
222
		$help = '<p>' . __( 'You can create groups of links by using Link Categories. Link Category names must be unique and Link Categories are separate from the categories you use for posts.' ) . '</p>';
223
	else
224
		$help = '<p>' . __( 'You can assign keywords to your posts using <strong>tags</strong>. Unlike categories, tags have no hierarchy, meaning there&#8217;s no relationship from one tag to another.' ) . '</p>';
225
226 View Code Duplication
	if ( 'link_category' == $taxonomy )
227
		$help .= '<p>' . __( 'You can delete Link Categories in the Bulk Action pull-down, but that action does not delete the links within the category. Instead, it moves them to the default Link Category.' ) . '</p>';
228
	else
229
		$help .='<p>' . __( 'What&#8217;s the difference between categories and tags? Normally, tags are ad-hoc keywords that identify important information in your post (names, subjects, etc) that may or may not recur in other posts, while categories are pre-determined sections. If you think of your site like a book, the categories are like the Table of Contents and the tags are like the terms in the index.' ) . '</p>';
230
231
	get_current_screen()->add_help_tab( array(
232
		'id'      => 'overview',
233
		'title'   => __('Overview'),
234
		'content' => $help,
235
	) );
236
237
	if ( 'category' == $taxonomy || 'post_tag' == $taxonomy ) {
238 View Code Duplication
		if ( 'category' == $taxonomy )
239
			$help = '<p>' . __( 'When adding a new category on this screen, you&#8217;ll fill in the following fields:' ) . '</p>';
240
		else
241
			$help = '<p>' . __( 'When adding a new tag on this screen, you&#8217;ll fill in the following fields:' ) . '</p>';
242
243
		$help .= '<ul>' .
244
		'<li>' . __( '<strong>Name</strong> &mdash; The name is how it appears on your site.' ) . '</li>';
245
246
		if ( ! global_terms_enabled() )
247
			$help .= '<li>' . __( '<strong>Slug</strong> &mdash; The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.' ) . '</li>';
248
249
		if ( 'category' == $taxonomy )
250
			$help .= '<li>' . __( '<strong>Parent</strong> &mdash; Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have child categories for Bebop and Big Band. Totally optional. To create a subcategory, just choose another category from the Parent dropdown.' ) . '</li>';
251
252
		$help .= '<li>' . __( '<strong>Description</strong> &mdash; The description is not prominent by default; however, some themes may display it.' ) . '</li>' .
253
		'</ul>' .
254
		'<p>' . __( 'You can change the display of this screen using the Screen Options tab to set how many items are displayed per screen and to display/hide columns in the table.' ) . '</p>';
255
256
		get_current_screen()->add_help_tab( array(
257
			'id'      => 'adding-terms',
258
			'title'   => 'category' == $taxonomy ? __( 'Adding Categories' ) : __( 'Adding Tags' ),
259
			'content' => $help,
260
		) );
261
	}
262
263
	$help = '<p><strong>' . __( 'For more information:' ) . '</strong></p>';
264
265
	if ( 'category' == $taxonomy )
266
		$help .= '<p>' . __( '<a href="https://codex.wordpress.org/Posts_Categories_Screen">Documentation on Categories</a>' ) . '</p>';
267
	elseif ( 'link_category' == $taxonomy )
268
		$help .= '<p>' . __( '<a href="https://codex.wordpress.org/Links_Link_Categories_Screen">Documentation on Link Categories</a>' ) . '</p>';
269
	else
270
		$help .= '<p>' . __( '<a href="https://codex.wordpress.org/Posts_Tags_Screen">Documentation on Tags</a>' ) . '</p>';
271
272
	$help .= '<p>' . __('<a href="https://wordpress.org/support/">Support Forums</a>') . '</p>';
273
274
	get_current_screen()->set_help_sidebar( $help );
275
276
	unset( $help );
277
}
278
279
require_once( ABSPATH . 'wp-admin/admin-header.php' );
280
281
/** Also used by the Edit Tag  form */
282
require_once( ABSPATH . 'wp-admin/includes/edit-tag-messages.php' );
283
284
$class = ( isset( $_REQUEST['error'] ) ) ? 'error' : 'updated';
285
286
if ( is_plugin_active( 'wpcat2tag-importer/wpcat2tag-importer.php' ) ) {
287
	$import_link = admin_url( 'admin.php?import=wpcat2tag' );
288
} else {
289
	$import_link = admin_url( 'import.php' );
290
}
291
292
?>
293
294
<div class="wrap nosubsub">
295
<h1 class="wp-heading-inline"><?php echo esc_html( $title ); ?></h1>
296
297
<?php
298 View Code Duplication
if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
299
	/* translators: %s: search keywords */
300
	printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( wp_unslash( $_REQUEST['s'] ) ) );
0 ignored issues
show
It seems like wp_unslash($_REQUEST['s']) targeting wp_unslash() can also be of type array; however, esc_html() does only seem to accept string, maybe add an additional type check?

This check looks at variables that are passed out again to other methods.

If the outgoing method call has stricter type requirements than the method itself, an issue is raised.

An additional type check may prevent trouble.

Loading history...
301
}
302
?>
303
304
<hr class="wp-header-end">
305
306
<?php if ( $message ) : ?>
307
<div id="message" class="<?php echo $class; ?> notice is-dismissible"><p><?php echo $message; ?></p></div>
308
<?php $_SERVER['REQUEST_URI'] = remove_query_arg( array( 'message', 'error' ), $_SERVER['REQUEST_URI'] );
309
endif; ?>
310
<div id="ajax-response"></div>
311
312
<form class="search-form wp-clearfix" method="get">
313
<input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" />
314
<input type="hidden" name="post_type" value="<?php echo esc_attr($post_type); ?>" />
315
316
<?php $wp_list_table->search_box( $tax->labels->search_items, 'tag' ); ?>
317
318
</form>
319
320
<div id="col-container" class="wp-clearfix">
321
322
<div id="col-left">
323
<div class="col-wrap">
324
325
<?php
326
327
if ( current_user_can($tax->cap->edit_terms) ) {
328
	if ( 'category' == $taxonomy ) {
329
		/**
330
 		 * Fires before the Add Category form.
331
		 *
332
		 * @since 2.1.0
333
		 * @deprecated 3.0.0 Use {$taxonomy}_pre_add_form instead.
334
		 *
335
		 * @param object $arg Optional arguments cast to an object.
336
		 */
337
		do_action( 'add_category_form_pre', (object) array( 'parent' => 0 ) );
338
	} elseif ( 'link_category' == $taxonomy ) {
339
		/**
340
		 * Fires before the link category form.
341
		 *
342
		 * @since 2.3.0
343
		 * @deprecated 3.0.0 Use {$taxonomy}_pre_add_form instead.
344
		 *
345
		 * @param object $arg Optional arguments cast to an object.
346
		 */
347
		do_action( 'add_link_category_form_pre', (object) array( 'parent' => 0 ) );
348
	} else {
349
		/**
350
		 * Fires before the Add Tag form.
351
		 *
352
		 * @since 2.5.0
353
		 * @deprecated 3.0.0 Use {$taxonomy}_pre_add_form instead.
354
		 *
355
		 * @param string $taxonomy The taxonomy slug.
356
		 */
357
		do_action( 'add_tag_form_pre', $taxonomy );
358
	}
359
360
	/**
361
	 * Fires before the Add Term form for all taxonomies.
362
	 *
363
	 * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
364
	 *
365
	 * @since 3.0.0
366
	 *
367
	 * @param string $taxonomy The taxonomy slug.
368
	 */
369
	do_action( "{$taxonomy}_pre_add_form", $taxonomy );
370
?>
371
372
<div class="form-wrap">
373
<h2><?php echo $tax->labels->add_new_item; ?></h2>
374
<form id="addtag" method="post" action="edit-tags.php" class="validate"<?php
375
/**
376
 * Fires inside the Add Tag form tag.
377
 *
378
 * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
379
 *
380
 * @since 3.7.0
381
 */
382
do_action( "{$taxonomy}_term_new_form_tag" );
383
?>>
384
<input type="hidden" name="action" value="add-tag" />
385
<input type="hidden" name="screen" value="<?php echo esc_attr($current_screen->id); ?>" />
386
<input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" />
387
<input type="hidden" name="post_type" value="<?php echo esc_attr($post_type); ?>" />
388
<?php wp_nonce_field('add-tag', '_wpnonce_add-tag'); ?>
389
390
<div class="form-field form-required term-name-wrap">
391
	<label for="tag-name"><?php _ex( 'Name', 'term name' ); ?></label>
392
	<input name="tag-name" id="tag-name" type="text" value="" size="40" aria-required="true" />
393
	<p><?php _e('The name is how it appears on your site.'); ?></p>
394
</div>
395
<?php if ( ! global_terms_enabled() ) : ?>
396
<div class="form-field term-slug-wrap">
397
	<label for="tag-slug"><?php _e( 'Slug' ); ?></label>
398
	<input name="slug" id="tag-slug" type="text" value="" size="40" />
399
	<p><?php _e('The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></p>
400
</div>
401
<?php endif; // global_terms_enabled() ?>
402
<?php if ( is_taxonomy_hierarchical($taxonomy) ) : ?>
403
<div class="form-field term-parent-wrap">
404
	<label for="parent"><?php echo esc_html( $tax->labels->parent_item ); ?></label>
405
	<?php
406
	$dropdown_args = array(
407
		'hide_empty'       => 0,
408
		'hide_if_empty'    => false,
409
		'taxonomy'         => $taxonomy,
410
		'name'             => 'parent',
411
		'orderby'          => 'name',
412
		'hierarchical'     => true,
413
		'show_option_none' => __( 'None' ),
414
	);
415
416
	/**
417
	 * Filters the taxonomy parent drop-down on the Edit Term page.
418
	 *
419
	 * @since 3.7.0
420
	 * @since 4.2.0 Added `$context` parameter.
421
	 *
422
	 * @param array  $dropdown_args {
423
	 *     An array of taxonomy parent drop-down arguments.
424
	 *
425
	 *     @type int|bool $hide_empty       Whether to hide terms not attached to any posts. Default 0|false.
426
	 *     @type bool     $hide_if_empty    Whether to hide the drop-down if no terms exist. Default false.
427
	 *     @type string   $taxonomy         The taxonomy slug.
428
	 *     @type string   $name             Value of the name attribute to use for the drop-down select element.
429
	 *                                      Default 'parent'.
430
	 *     @type string   $orderby          The field to order by. Default 'name'.
431
	 *     @type bool     $hierarchical     Whether the taxonomy is hierarchical. Default true.
432
	 *     @type string   $show_option_none Label to display if there are no terms. Default 'None'.
433
	 * }
434
	 * @param string $taxonomy The taxonomy slug.
435
	 * @param string $context  Filter context. Accepts 'new' or 'edit'.
436
	 */
437
	$dropdown_args = apply_filters( 'taxonomy_parent_dropdown_args', $dropdown_args, $taxonomy, 'new' );
438
439
	wp_dropdown_categories( $dropdown_args );
440
	?>
441
	<?php if ( 'category' == $taxonomy ) : ?>
442
		<p><?php _e( 'Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have children categories for Bebop and Big Band. Totally optional.' ); ?></p>
443
	<?php else : ?>
444
		<p><?php _e( 'Assign a parent term to create a hierarchy. The term Jazz, for example, would be the parent of Bebop and Big Band.' ); ?></p>
445
	<?php endif; ?>
446
</div>
447
<?php endif; // is_taxonomy_hierarchical() ?>
448
<div class="form-field term-description-wrap">
449
	<label for="tag-description"><?php _e( 'Description' ); ?></label>
450
	<textarea name="description" id="tag-description" rows="5" cols="40"></textarea>
451
	<p><?php _e('The description is not prominent by default; however, some themes may show it.'); ?></p>
452
</div>
453
454
<?php
455
if ( ! is_taxonomy_hierarchical( $taxonomy ) ) {
456
	/**
457
	 * Fires after the Add Tag form fields for non-hierarchical taxonomies.
458
	 *
459
	 * @since 3.0.0
460
	 *
461
	 * @param string $taxonomy The taxonomy slug.
462
	 */
463
	do_action( 'add_tag_form_fields', $taxonomy );
464
}
465
466
/**
467
 * Fires after the Add Term form fields.
468
 *
469
 * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
470
 *
471
 * @since 3.0.0
472
 *
473
 * @param string $taxonomy The taxonomy slug.
474
 */
475
do_action( "{$taxonomy}_add_form_fields", $taxonomy );
476
477
submit_button( $tax->labels->add_new_item );
478
479
if ( 'category' == $taxonomy ) {
480
	/**
481
	 * Fires at the end of the Edit Category form.
482
	 *
483
	 * @since 2.1.0
484
	 * @deprecated 3.0.0 Use {$taxonomy}_add_form instead.
485
	 *
486
	 * @param object $arg Optional arguments cast to an object.
487
	 */
488
	do_action( 'edit_category_form', (object) array( 'parent' => 0 ) );
489
} elseif ( 'link_category' == $taxonomy ) {
490
	/**
491
	 * Fires at the end of the Edit Link form.
492
	 *
493
	 * @since 2.3.0
494
	 * @deprecated 3.0.0 Use {$taxonomy}_add_form instead.
495
	 *
496
	 * @param object $arg Optional arguments cast to an object.
497
	 */
498
	do_action( 'edit_link_category_form', (object) array( 'parent' => 0 ) );
499
} else {
500
	/**
501
	 * Fires at the end of the Add Tag form.
502
	 *
503
	 * @since 2.7.0
504
	 * @deprecated 3.0.0 Use {$taxonomy}_add_form instead.
505
	 *
506
	 * @param string $taxonomy The taxonomy slug.
507
	 */
508
	do_action( 'add_tag_form', $taxonomy );
509
}
510
511
/**
512
 * Fires at the end of the Add Term form for all taxonomies.
513
 *
514
 * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
515
 *
516
 * @since 3.0.0
517
 *
518
 * @param string $taxonomy The taxonomy slug.
519
 */
520
do_action( "{$taxonomy}_add_form", $taxonomy );
521
?>
522
</form></div>
523
<?php } ?>
524
525
</div>
526
</div><!-- /col-left -->
527
528
<div id="col-right">
529
<div class="col-wrap">
530
<form id="posts-filter" method="post">
531
<input type="hidden" name="taxonomy" value="<?php echo esc_attr( $taxonomy ); ?>" />
532
<input type="hidden" name="post_type" value="<?php echo esc_attr( $post_type ); ?>" />
533
534
<?php $wp_list_table->display(); ?>
535
536
</form>
537
538
<?php if ( 'category' == $taxonomy ) : ?>
539
<div class="form-wrap edit-term-notes">
540
<p>
541
	<?php
542
	echo '<strong>' . __( 'Note:' ) . '</strong><br />';
543
	printf(
544
		/* translators: %s: default category */
545
		__( 'Deleting a category does not delete the posts in that category. Instead, posts that were only assigned to the deleted category are set to the category %s.' ),
546
		/** This filter is documented in wp-includes/category-template.php */
547
		'<strong>' . apply_filters( 'the_category', get_cat_name( get_option( 'default_category') ) ) . '</strong>'
548
	);
549
	?>
550
</p>
551
<?php if ( current_user_can( 'import' ) ) : ?>
552
<p><?php printf( __( 'Categories can be selectively converted to tags using the <a href="%s">category to tag converter</a>.' ), esc_url( $import_link ) ) ?></p>
553
<?php endif; ?>
554
</div>
555
<?php elseif ( 'post_tag' == $taxonomy && current_user_can( 'import' ) ) : ?>
556
<div class="form-wrap edit-term-notes">
557
<p><?php printf( __( 'Tags can be selectively converted to categories using the <a href="%s">tag to category converter</a>.' ), esc_url( $import_link ) ) ;?></p>
558
</div>
559
<?php endif;
560
561
/**
562
 * Fires after the taxonomy list table.
563
 *
564
 * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
565
 *
566
 * @since 3.0.0
567
 *
568
 * @param string $taxonomy The taxonomy name.
569
 */
570
do_action( "after-{$taxonomy}-table", $taxonomy );
571
?>
572
573
</div>
574
</div><!-- /col-right -->
575
576
</div><!-- /col-container -->
577
</div><!-- /wrap -->
578
579
<?php if ( ! wp_is_mobile() ) : ?>
580
<script type="text/javascript">
581
try{document.forms.addtag['tag-name'].focus();}catch(e){}
582
</script>
583
<?php
584
endif;
585
586
$wp_list_table->inline_edit();
587
588
include( ABSPATH . 'wp-admin/admin-footer.php' );
589