From 24afea92c20d0ac1a550e1b16707e8bd2cfa1cd7 Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Fri, 11 Dec 2015 22:49:41 +0000 Subject: [PATCH] When editing terms, properly display an admin `notice-warning` when `tag_ID` is empty. Also, avoids two related PHP notices when empty or not set (and thus the global `$tag` is a WP_Error object). Fixes: #34515. Built from https://develop.svn.wordpress.org/trunk@35875 git-svn-id: http://core.svn.wordpress.org/trunk@35839 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/edit-tag-form.php | 5 ++++- wp-admin/edit-tags.php | 4 ++++ wp-includes/admin-bar.php | 2 +- wp-includes/version.php | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/wp-admin/edit-tag-form.php b/wp-admin/edit-tag-form.php index 8b5c61b164..b8d23402cd 100644 --- a/wp-admin/edit-tag-form.php +++ b/wp-admin/edit-tag-form.php @@ -11,7 +11,10 @@ if ( !defined('ABSPATH') ) die('-1'); if ( empty($tag_ID) ) { ?> -

+
+

labels->edit_item; ?>

+

+
labels->edit_item; + if ( ! isset( $_REQUEST['tag_ID'] ) ) { + break; + } + $tag_ID = (int) $_REQUEST['tag_ID']; $tag = get_term( $tag_ID, $taxonomy, OBJECT, 'edit' ); diff --git a/wp-includes/admin-bar.php b/wp-includes/admin-bar.php index 2bf56a8630..ac117f7a52 100644 --- a/wp-includes/admin-bar.php +++ b/wp-includes/admin-bar.php @@ -574,7 +574,7 @@ function wp_admin_bar_edit_menu( $wp_admin_bar ) { ) ); } } elseif ( 'edit-tags' == $current_screen->base - && isset( $tag ) && is_object( $tag ) + && isset( $tag ) && is_object( $tag ) && ! is_wp_error( $tag ) && ( $tax = get_taxonomy( $tag->taxonomy ) ) && $tax->public ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 3ea5c921b6..976870b312 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.5-alpha-35874'; +$wp_version = '4.5-alpha-35875'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.