| @@ -10,8 +10,18 @@ | ||
| 10 | 10 | * We emit one inline CSS rule per submenu URL of the current parent |
| 11 | 11 | * menu, matching `.page-title-action` on its `href`. A button is |
| 12 | 12 | * hidden only when its destination is a tab in the same window. |
| 13 | 13 | * |
| 14 | + * The match is on `href`, at any depth inside `.wrap`. Core renders | |
| 15 | + * the button as a direct child, but a plugin is free to move it: on | |
| 16 | + * a Jetpack site the external-media package lifts core's "Add Media | |
| 17 | + * File" out of `.wrap` into a `div.wpcom-media-library-action-buttons` | |
| 18 | + * of its own so it can append "Import Media" beside it, and Big Sky | |
| 19 | + * inserts "Generate Image" into the same box. A `>` combinator stops | |
| 20 | + * at the wrapper and every one of those buttons survives next to the | |
| 21 | + * tab that already leads there. Depth says nothing about where a | |
| 22 | + * button goes, so it is not part of the test. | |
| 23 | + * | |
| 14 | 24 | * Matching is on the exact href, never a partial path compare. A |
| 15 | 25 | * missed match leaves a redundant button; a loose match takes away |
| 16 | 26 | * the only route to a page. So these all stay visible: |
| 17 | 27 | * |
| @@ -171,9 +181,9 @@ | ||
| 171 | 181 | } |
| 172 | 182 | } |
| 173 | 183 | |
| 174 | 184 | foreach ( $hrefs as $href ) { |
| 175 | - $selectors[] = '.os-chromeless .wrap > .page-title-action[href="' | |
| 185 | + $selectors[] = '.os-chromeless .wrap .page-title-action[href="' | |
| 176 | 186 | . openstation_chromeless_css_attr_value( $href ) . '"]' . $exclusions; |
| 177 | 187 | } |
| 178 | 188 | } |
| 179 | 189 | |