Home › Forums › ACF PRO › Trigger a blank row in a flex content on button click › Reply To: Trigger a blank row in a flex content on button click
I’m replying because I don’t think that you’re going to get anything that will tell you exactly what to do. Working on the JS side of ACF is not something there is a lot of information about. I’m not even sure that what you’re trying to do is possible.
If I had to do this I would start by looking in the file
advanced-custom-fields-pro/pro/assets/js/acf-pro-input.js
In this file on about line 523 you’ll find
acf.fields.flexible_content = acf.field.extend({
This is where the code for the flex field can be found. In this section you’ll find two functions that do this in ACF. _open
is the function that opens the window and _add
is the function that adds the layout. You’re going to have to somehow recreate what these two functions do.
I’ve looked at it and to be honest, there’s too much work there for me to try it. Honestly, I wouldn’t go to that much trouble to save a user a click. There’d need to be a more important reason.
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.