WordPress.org

Make WordPress Core

#44007 closed defect (bug) (invalid)

Making a child theme link should open in new tab

Reported by: subrataemfluence Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Themes Keywords: has-patch close
Focuses: accessibility Cc:
PR Number:

Description

Making a child theme link inside Heads Up popup in theme Editor page should open in new tab. Presently it opens in the same tab and taking user away from the main site.

Attachments (3)

Heads-Up-Popup.png (35.0 KB) - added by subrataemfluence 18 months ago.
44007.diff (1.1 KB) - added by subrataemfluence 18 months ago.
44007.2.diff (2.2 KB) - added by audrasjb 17 months ago.
adding 2 target blank and some informations about liks opening in a new window

Download all attachments as: .zip

Change History (13)

#1 @subrataemfluence
18 months ago

  • Keywords has-patch added; needs-patch removed

#2 @SergeyBiryukov
17 months ago

  • Component changed from Editor to Themes

#3 @subrataemfluence
17 months ago

@SergeyBiryukov Just curious to know whether Themes is the right component to tag with! Since the file theme-editor.php is a part of WordPress core and it resides inside wp-admin directory, doesn't it work the same way irrespective of the Active theme?

#4 @audrasjb
17 months ago

  • Focuses accessibility added; administration removed
  • Keywords 2nd-opinion added

Hi @subrataemfluence ,

Maybe I'm wrong but I guess this ticket is relevant as the user is currently doing an action which involves forms and writing.
Related: Links destination section in a11y handbook --> https://make.wordpress.org/accessibility/handbook/best-practices/content/link-destinations/#but-what-if-you-insist

I think the Themescomponent is the right place for this ticket since this component is about Appereance admin screens.

In 44007.2.diff

  • Added target blank to the second related string.
  • Added some textual informations about links opening in a new window

Cheers,
Jb

@audrasjb
17 months ago

adding 2 target blank and some informations about liks opening in a new window

#5 @subrataemfluence
17 months ago

@audrasjb Perfect! Thank you for correcting me. I am still a learner. :)

This ticket was mentioned in Slack in #accessibility by afercia. View the logs.


17 months ago

#7 @afercia
17 months ago

  • Keywords reporter-feedback close added; 2nd-opinion removed

We've discussed this ticket during today's accessibility bug-scrub. In core, target=_blank is discouraged unless there's the risk of data loss (e.g. when something has been entered in a form). There has been some previous work and discussion on target=_blank see https://core.trac.wordpress.org/query?keywords=~target-blank

In this specific case, we're not sure what the value of opening a new tab would be. As a general rule, links should just navigate to a new page in the same tab. Considering that:

  • this popup appears just once
  • clicking the link doesn’t causes any loss of data, as nothing has been edited yet

We'd be inclined to not use target=_blank in this case, unless there some specific scenario where it would be valuable.

@subrataemfluence when you have a chance, could you please explain why this link should open in a new tab in your opinion?

#8 @anevins
17 months ago

I also think in this case that context really matters. I would like to think that once that link is pressed, the user starts a new journey of doing things the right way and does not need to retain the tab of doing things the wrong way

#9 @subrataemfluence
17 months ago

@afercia This is a question of usability.

As a user I would not mind to navigate away to an external URL if I can get back to the previous page easily e.g. by clicking another link pointing to the page where I was

But in this case (although the popup appears only once), I have no option like above and have to manually type in the address again to get back to the page.

In my opinion, this is not a very good practice to navigate to somewhere which does not allow me to come back easily to where I originally was.

#10 @afercia
17 months ago

  • Keywords reporter-feedback removed
  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

if I can get back to the previous page easily

Your browser "Back" button serves that purpose :) The recommended approach for accessibility is to not take control of the users browsers and let users decide. Browsers have implemented tabbed navigation since 15 years or so. you can Ctrl (or Cmd) click a link etc. to open a new tab.

I have no option like above and have to manually type in the address again to get back to the page.

I'm not sure I understand what prevents you from using your browser's Back button. That's pretty standard.

I'd also add that opening links in a new tab does actually breaks the browser's history, as clicking "Back" won't do anything.

Again, the accessibility team recommendation is to avoid to use target=_blank unless there's really a very good reason to use it, and we'd say this is not the case. Please see also https://make.wordpress.org/accessibility/handbook/best-practices/content/link-destinations/#the-link-opens-in-a-window-or-tab

Note: See TracTickets for help on using tickets.