WordPress.org

Make WordPress Core

Changeset 47222


Ignore:
Timestamp:
02/09/2020 07:39:54 PM (20 months ago)
Author:
joedolson
Message:

Editor: Fix incorrect usage of ID attributes on custom fields.

Repeated containers used for custom fields have duplicate ID attributes. Duplicate IDs are incorrect HTML, and will also cause unexpected results when trying to manipulate using JS. Duplicate IDs are changed to matching classes; CSS & JS updated to match.

Props jankimoradiya, audrasjb, donmhico, afercia.
Fixes #46964.

Location:
trunk/src
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/admin/postbox.js

    r47122 r47222  
    422422                case 0:
    423423                case 180:
    424                     if ( $('#poststuff').length ) {
     424                    if ( $( '.poststuff' ).length ) {
    425425                        this._pb_edit(1);
    426426                    } else {
  • trunk/src/wp-admin/css/dashboard.css

    r46770 r47222  
    77}
    88
    9 #wpbody-content #dashboard-widgets.columns-2 #postbox-container-2,
     9#wpbody-content #dashboard-widgets.columns-2 .postbox-container-2,
    1010#wpbody-content #dashboard-widgets.columns-2 #postbox-container-3,
    1111#wpbody-content #dashboard-widgets.columns-2 #postbox-container-4 {
     
    4343}
    4444
    45 .ie8 #wpbody-content #dashboard-widgets #postbox-container-2,
     45.ie8 #wpbody-content #dashboard-widgets .postbox-container-2,
    4646.ie8 #wpbody-content #dashboard-widgets #postbox-container-3,
    4747.ie8 #wpbody-content #dashboard-widgets #postbox-container-4 {
     
    11131113    }
    11141114
    1115     #wpbody-content #dashboard-widgets #postbox-container-2,
     1115    #wpbody-content #dashboard-widgets .postbox-container-2,
    11161116    #wpbody-content #dashboard-widgets #postbox-container-3,
    11171117    #wpbody-content #dashboard-widgets #postbox-container-4 {
  • trunk/src/wp-admin/css/edit.css

    r47209 r47222  
    1 #poststuff {
     1.poststuff {
    22    padding-top: 10px;
    33    min-width: 763px;
    44}
    55
    6 #poststuff #post-body {
     6.poststuff #post-body {
    77    padding: 0;
    88}
    99
    10 #poststuff .postbox-container {
     10.poststuff .postbox-container {
    1111    width: 100%;
    1212}
    1313
    14 #poststuff #post-body.columns-2 {
     14.poststuff #post-body.columns-2 {
    1515    margin-right: 300px;
    1616}
     
    5252}
    5353
    54 #poststuff #titlewrap {
     54.poststuff #titlewrap {
    5555    border: 0;
    5656    padding: 0;
     
    415415}
    416416
    417 #poststuff #post-body.columns-2 #side-sortables {
     417.poststuff #post-body.columns-2 #side-sortables {
    418418    width: 280px;
    419419}
     
    597597}
    598598
    599 #poststuff h3.hndle, /* Back-compat for pre-4.4 */
    600 #poststuff .stuffbox > h3, /* Back-compat for pre-4.4 */
    601 #poststuff h2 {
     599.poststuff h3.hndle, /* Back-compat for pre-4.4 */
     600.poststuff .stuffbox > h3, /* Back-compat for pre-4.4 */
     601.poststuff h2 {
    602602    font-size: 14px;
    603603    padding: 8px 12px;
     
    606606}
    607607
    608 #poststuff .stuffbox h2 {
     608.poststuff .stuffbox h2 {
    609609    padding: 8px 10px;
    610610}
    611611
    612 #poststuff .inside {
     612.poststuff .inside {
    613613    margin: 6px 0 0 0;
    614614}
    615615
    616 #poststuff .stuffbox .inside {
     616.poststuff .stuffbox .inside {
    617617    margin: 0;
    618618}
    619619
    620 #poststuff .inside #parent_id,
    621 #poststuff .inside #page_template {
     620.poststuff .inside #parent_id,
     621.poststuff .inside #page_template {
    622622    max-width: 100%;
    623623}
    624624
    625 .ie8 #poststuff .inside #parent_id,
    626 .ie8 #poststuff .inside #page_template {
     625.ie8 .poststuff .inside #parent_id,
     626.ie8 .poststuff .inside #page_template {
    627627    width: 250px;
    628628}
     
    643643
    644644#linksubmitdiv .inside, /* Old Link Manager back-compat. */
    645 #poststuff #submitdiv .inside {
     645.poststuff #submitdiv .inside {
    646646    margin: 0;
    647647    padding: 0;
     
    10921092------------------------------------------------------------------------------*/
    10931093
    1094 #poststuff .tagsdiv .ajaxtag {
     1094.poststuff .tagsdiv .ajaxtag {
    10951095    margin-top: 1em;
    10961096}
    10971097
    1098 #poststuff .tagsdiv .howto {
     1098.poststuff .tagsdiv .howto {
    10991099    margin: 1em 0 6px 0;
    11001100}
     
    11411141}
    11421142
    1143 #poststuff .inside .the-tagcloud {
     1143.poststuff .inside .the-tagcloud {
    11441144    margin: 5px 0 10px;
    11451145    padding: 8px;
     
    14131413/* one column on the post write/edit screen */
    14141414@media only screen and (max-width: 850px) {
    1415     #poststuff {
     1415    .poststuff {
    14161416        min-width: 0;
    14171417    }
    14181418
    1419     #wpbody-content #poststuff #post-body {
     1419    #wpbody-content .poststuff #post-body {
    14201420        margin: 0;
    14211421    }
     
    14261426    }
    14271427
    1428     #poststuff #postbox-container-1 .empty-container,
    1429     #poststuff #postbox-container-1 #side-sortables:empty {
     1428    .poststuff #postbox-container-1 .empty-container,
     1429    .poststuff #postbox-container-1 #side-sortables:empty {
    14301430        border: 0 none;
    14311431        height: 0;
     
    14331433    }
    14341434
    1435     #poststuff #post-body.columns-2 #side-sortables {
     1435    .poststuff #post-body.columns-2 #side-sortables {
    14361436        min-height: 0;
    14371437        width: auto;
     
    14581458    }
    14591459
    1460     #poststuff .stuffbox .inside {
     1460    .poststuff .stuffbox .inside {
    14611461        padding: 0 2px 4px 0;
    14621462    }
    14631463
    1464     #poststuff h3.hndle, /* Back-compat for pre-4.4 */
    1465     #poststuff .stuffbox > h3, /* Back-compat for pre-4.4 */
    1466     #poststuff h2 {
     1464    .poststuff h3.hndle, /* Back-compat for pre-4.4 */
     1465    .poststuff .stuffbox > h3, /* Back-compat for pre-4.4 */
     1466    .poststuff h2 {
    14671467        padding: 12px;
    14681468    }
  • trunk/src/wp-admin/css/ie.css

    r44961 r47222  
    1414}
    1515
    16 #wpbody-content #dashboard-widgets #postbox-container-2,
     16#wpbody-content #dashboard-widgets .postbox-container-2,
    1717#wpbody-content #dashboard-widgets #postbox-container-3,
    1818#wpbody-content #dashboard-widgets #postbox-container-4 {
     
    368368#postdivrich,
    369369#postdiv,
    370 #poststuff,
     370.poststuff,
    371371.metabox-holder,
    372372#titlediv,
     
    415415}
    416416
    417 #poststuff h2 {
     417.poststuff h2 {
    418418    font-size: 1.6em;
    419419}
    420420
    421 #poststuff .inside #parent_id,
    422 #poststuff .inside #page_template,
     421.poststuff .inside #parent_id,
     422.poststuff .inside #page_template,
    423423.inline-edit-row #post_parent,
    424424.inline-edit-row select[name="page_template"] {
     
    678678}
    679679
    680 * html #poststuff h2 {
     680* html .poststuff h2 {
    681681    margin-left: 0;
    682682}
  • trunk/src/wp-admin/css/media.css

    r46856 r47222  
    10341034}
    10351035
    1036 #poststuff .imgedit-group-top h2 {
     1036.poststuff .imgedit-group-top h2 {
    10371037    display: inline-block;
    10381038    margin: 0;
     
    10421042}
    10431043
    1044 #poststuff .imgedit-group-top .button-link {
     1044.poststuff .imgedit-group-top .button-link {
    10451045    text-decoration: none;
    10461046    color: #23282d;
  • trunk/src/wp-admin/edit-form-advanced.php

    r47219 r47222  
    495495?>
    496496
    497 <div id="poststuff">
     497<div class="poststuff">
    498498<div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>">
    499499<div id="post-body-content">
     
    672672?>
    673673</div>
    674 <div id="postbox-container-2" class="postbox-container">
     674<div class="postbox-container-2 postbox-container">
    675675<?php
    676676
  • trunk/src/wp-admin/edit-form-comment.php

    r47122 r47222  
    1717<h1><?php _e( 'Edit Comment' ); ?></h1>
    1818
    19 <div id="poststuff">
     19<div class="poststuff">
    2020<input type="hidden" name="action" value="editedcomment" />
    2121<input type="hidden" name="comment_ID" value="<?php echo esc_attr( $comment->comment_ID ); ?>" />
     
    197197</div>
    198198
    199 <div id="postbox-container-2" class="postbox-container">
     199<div class="postbox-container-2 postbox-container">
    200200<?php
    201201/** This action is documented in wp-admin/includes/meta-boxes.php */
  • trunk/src/wp-admin/edit-link-form.php

    r47198 r47222  
    107107?>
    108108
    109 <div id="poststuff">
     109<div class="poststuff">
    110110
    111111<div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>">
     
    145145?>
    146146</div>
    147 <div id="postbox-container-2" class="postbox-container">
     147<div class="postbox-container-2 postbox-container">
    148148<?php
    149149
  • trunk/src/wp-admin/includes/dashboard.php

    r47219 r47222  
    246246    <?php do_meta_boxes( $screen->id, 'normal', '' ); ?>
    247247    </div>
    248     <div id="postbox-container-2" class="postbox-container">
     248    <div class="postbox-container-2 postbox-container">
    249249    <?php do_meta_boxes( $screen->id, 'side', '' ); ?>
    250250    </div>
  • trunk/src/wp-admin/includes/post.php

    r47219 r47222  
    22722272    <?php foreach ( $locations as $location ) : ?>
    22732273        <form class="metabox-location-<?php echo esc_attr( $location ); ?>" onsubmit="return false;">
    2274             <div id="poststuff" class="sidebar-open">
    2275                 <div id="postbox-container-2" class="postbox-container">
     2274            <div class="poststuff" class="sidebar-open">
     2275                <div class="postbox-container-2 postbox-container">
    22762276                    <?php
    22772277                    do_meta_boxes(
Note: See TracChangeset for help on using the changeset viewer.