Up!
I’ve managed to apply IDs to all WYSIWYG fields, but how could intercept a specific field with its key?
this is the code applied:
function my_heading_ids($content) {
$content = preg_replace_callback(“/\<h([4])/”, function ($matches) {
static $num = 1;
$hTag = $matches[4];
return ‘<h4′. $hTag .’ id=”my’ . $num++ . ‘”‘;
}, $content);
return $content;
}
add_filter(‘acf_the_content’, ‘my_heading_ids’);
Thanks
I’ve managed to find out subfield keys printing a PHP of the main field in tools section of ACF!
I’m sorry but i just can’t find out where to switch field key view on/off!
These are my screens from ACF
Ok, this sounds clear and simple, but i just can’t find out subfields keys. I easily found the main field key, but not the same for subfields. Do i have to search in my DB? ACF version: latest, i think 5.1.1
Hi Jarvis,
first of all, thank you for the support provided!
My ACF field is already a Repeater with oEmbed subfields inside.
I just want to pass data from post creation form to each subfield into repeater. As i can see from the code you posted, i should create a repeater field with only ONE oEmbed row inside, then i have to match form ID with ACF keys, and the code will add as many rows as many submission people will perform, right?
I’ll try, thanks!
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.