Make WordPress Core


Ignore:
Timestamp:
08/20/2024 05:48:07 PM (19 months ago)
Author:
SergeyBiryukov
Message:

Taxonomy: Correct the check for error messages in wp-admin/edit-tag-form.php.

Instead of checking for a specific message, e.g. “Item not updated”, the $_REQUEST['error'] variable is now checked. This allows for custom messages added via the term_updated_messages filter to be considered an error when appropriate, and displayed with the correct CSS class.

This also brings consistency with a similar check in wp-admin/edit-tags.php.

Follow-up to [31823], [44663].

Props xipasduarte.
Fixes #61896.

File:
1 edited

Legend:

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

    r58581 r58918  
    7373
    7474<?php
    75 $class = ( isset( $msg ) && 5 === $msg ) ? 'error' : 'success';
     75$class = ( isset( $_REQUEST['error'] ) ) ? 'error' : 'success';
    7676
    7777if ( $message ) {
     
    8484        );
    8585    }
     86
    8687    wp_admin_notice(
    8788        $message,
Note: See TracChangeset for help on using the changeset viewer.