[wp-trac] [WordPress Trac] #35047: Notices are not moved to first header when header-elements are nested inside .wrap
WordPress Trac
noreply at wordpress.org
Sun Dec 13 14:43:34 UTC 2015
#35047: Notices are not moved to first header when header-elements are nested
inside .wrap
------------------------------------+-----------------------------
Reporter: DvanKooten | Owner: afercia
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 4.4.1
Component: Administration | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch dev-feedback | Focuses: ui, javascript
------------------------------------+-----------------------------
Comment (by afercia):
Thanks @DvanKooten so here's a screenshot to illustrate the issue, with
notices from another popular plugin. WordPress 4.2 above and trunk below:
[[Image(https://cldup.com/vHrKWQhdVS.png)]]
After all, the previous jQuery selector was `$firstHeading = $( 'div.wrap
h2:first' );` and as @DvanKooten points out it was getting the first H2
regardless of how many level down in the DOM tree it was. So
`$( '.wrap' ).find( ':header' ).first()`
would basically restore the same behavior. Or maybe even better, simpler,
and faster:
`$( '.wrap h1, .wrap h2' ).first()`
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35047#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list