Die when attempting to edit non-existent term. Props johnbillion. fixes #18718
git-svn-id: https://develop.svn.wordpress.org/trunk@18954 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
9566269dfc
commit
3ed641402e
@ -113,10 +113,12 @@ break;
|
||||
case 'edit':
|
||||
$title = $tax->labels->edit_item;
|
||||
|
||||
require_once ( 'admin-header.php' );
|
||||
$tag_ID = (int) $_REQUEST['tag_ID'];
|
||||
|
||||
$tag = get_term( $tag_ID, $taxonomy, OBJECT, 'edit' );
|
||||
if ( ! $tag )
|
||||
wp_die( __( 'You attempted to edit an item that doesn’t exist. Perhaps it was deleted?' ) );
|
||||
require_once ( 'admin-header.php' );
|
||||
include( './edit-tag-form.php' );
|
||||
|
||||
break;
|
||||
@ -127,6 +129,10 @@ case 'editedtag':
|
||||
|
||||
if ( !current_user_can( $tax->cap->edit_terms ) )
|
||||
wp_die( __( 'Cheatin’ uh?' ) );
|
||||
|
||||
$tag = get_term( $tag_ID, $taxonomy );
|
||||
if ( ! $tag )
|
||||
wp_die( __( 'You attempted to edit an item that doesn’t exist. Perhaps it was deleted?' ) );
|
||||
|
||||
$ret = wp_update_term( $tag_ID, $taxonomy, $_POST );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user