WordPress.org

Make WordPress Core

Changeset 35875


Ignore:
Timestamp:
12/11/2015 10:48:49 PM (6 years ago)
Author:
afercia
Message:

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.

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/edit-tag-form.php

    r34319 r35875  
    1212
    1313if ( empty($tag_ID) ) { ?>
    14     <div id="message" class="updated notice is-dismissible"><p><strong><?php _e( 'You did not select an item for editing.' ); ?></strong></p></div>
     14<div class="wrap">
     15    <h1><?php echo $tax->labels->edit_item; ?></h1>
     16    <div id="message" class="notice notice-warning"><p><strong><?php _e( 'You did not select an item for editing.' ); ?></strong></p></div>
     17</div>
    1518<?php
    1619    return;
  • trunk/src/wp-admin/edit-tags.php

    r35376 r35875  
    152152case 'edit':
    153153    $title = $tax->labels->edit_item;
     154
     155    if ( ! isset( $_REQUEST['tag_ID'] ) ) {
     156        break;
     157    }
    154158
    155159    $tag_ID = (int) $_REQUEST['tag_ID'];
  • trunk/src/wp-includes/admin-bar.php

    r35749 r35875  
    575575            }
    576576        } elseif ( 'edit-tags' == $current_screen->base
    577             && isset( $tag ) && is_object( $tag )
     577            && isset( $tag ) && is_object( $tag ) && ! is_wp_error( $tag )
    578578            && ( $tax = get_taxonomy( $tag->taxonomy ) )
    579579            && $tax->public )
Note: See TracChangeset for help on using the changeset viewer.