AdvancedCustomFields / AdvancedCustomFields/acf

link field target should return _self if "open in new window" is unchecked

Open
#393 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
945
Forks
197
PR merge metrics
No merged PRs in 30d

Description

I was doing html validation on a site and it returned errors because my targets were empty. I was doing $link = get_field( 'link'); and echoing target="$link['target']". I had to change to code to only echo target="_blank" if '_blank' === $link['target'] which works but since the browser default is _self I think that the field array should have target _self by default. I'm will to do a pull request for this too

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue’s entry point is the get_field('link') result used when rendering an HTML link; inspect how the link field array supplies target when “open in new window” is unchecked. Reproduce the empty-target validation case and verify the unchecked state yields _self while the checked state remains _blank.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.