I needed to set the aria-label
of my links with the post title, a custom field value and a hard-coded string. The default Pinegrow Set ACF Field
action allows you to replace or append an attribute (in my case aria-label
) with the field value, but the values are limited to custom fields, so it wasn’t ideal for my use case.
My default link markup looked like this:
<a href="https://rusmiller.com" target="_blank" rel="noreferrer noopener" aria-label="Job title:">WordPress Developer/Designer</a>
I initially configured the Display ACF Field action like this:

This produced the following markup:
<a href="https://rusmiller.com" target="_blank" rel="noreferrer noopener" aria-label="Job title: WordPress Developer/Designer">WordPress Developer/Designer</a>
This was great, but didn’t go far enough. So I removed the aria-label value Job title:, along with the ACF action, and added three PHP Code actions instead. In sequence, they retrieved the job_title
field value and appended a dash, then appended the post title, and finally a bit of info informing the user that the link would open in another tab, then appended all to the default aria-label
value.

This produced the following markup:
<a href="https://rusmiller.com" target="_blank" rel="noreferrer noopener" aria-label="WordPress Developer/Designer - Self-Employed (opens in a new tab)">WordPress Developer/Designer</a>