Open PthPndr opened 7 years ago
You need to pull the fieldid from the ACF field. If you are in the custom fields page, click on "screen options" and then select "show field slugs" (or something along those lines). That's where you get the field* identifier.
Hey Snake!
Can you write up an full example of how the AJAX GET works with screenshots?
Hello SnakeO, I'm using your plugin with ACF Pro. I need a button that open this url with some ACF field injected :
But I receive an issue: Error: Syntax error, unrecognized expression: input[name=acf[field_5b41d7b3afe8b]]
What's wrong with my syntax? However I pull the field_id from the ACF field. I'm lost!
I believe the plugin is broken in that regard
got to adjust it manually
file button-v5.php in the source code, line 235
there have to be brackets in input[name="field_...."]
otherwise jquery throws exception.
so line 235 to make it work:
var val = $('input[name="' + name + '"]').val();
Thanks, I see there was a pull request for that. I've added it into the code.
Hello, I recently stumbled across your ACF field and had a question.
If I try an AJAX GET with the following it works great: /wp-admin/admin-ajax.php?action=some_action
If I try following your example and inject an ACF value nothing happens when I click the button: /wp-admin/admin-ajax.php?action=some_action&var={acf[field_5691f90569c3a]}
Admittedly, I do not have a lot of experience when it comes to AJAX and it could be entirely me but is this still the correct format for injecting ACF values?