Make WordPress Core


Ignore:
Timestamp:
09/17/2023 10:49:06 PM (3 years ago)
Author:
joedolson
Message:

Administration: Move tabindex="-1" from notice to JS.

In a handful of admin notices, a tabindex attribute is set so that JS can move focus to the notice div. Rather than adding tabindex to globally accepted attributes for wp_kses_post(), move the assignment of tabindex into the JS handlers that display those notices. The attribute is only relevant if JS is running, so there is no reason to add it in the original HTML notice.

Follow up to [56408], [56409], [56410], [56518], [56570], [56571], [56572], [56573], [56576], [56589], [56590], [56597], [56599], [56600], [56601].

Props costdev, joedolson.
See #57791.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/image-edit.php

    r56549 r56602  
    4040    if ( $msg ) {
    4141        if ( isset( $msg->error ) ) {
    42             $note = "<div class='notice notice-error' tabindex='-1' role='alert'><p>$msg->error</p></div>";
     42            $note = "<div class='notice notice-error' role='alert'><p>$msg->error</p></div>";
    4343        } elseif ( isset( $msg->msg ) ) {
    44             $note = "<div class='notice notice-success' tabindex='-1' role='alert'><p>$msg->msg</p></div>";
     44            $note = "<div class='notice notice-success' role='alert'><p>$msg->msg</p></div>";
    4545        }
    4646    }
Note: See TracChangeset for help on using the changeset viewer.