Oxygen Builder: Making Ajax Calls from Code Block

622 views Asked by At

Yeah, so this is super frustrating. It should be a simple answer for someone...

I am trying to simply figure out how to make a call to admin-ajax.php from a Code Block within Oxygen and I can't figure out how this is supposed to be working.

I'm assuming there's already an object for it, but there is no documentation at all.

My JS is within the code block and I just need to send some form information to admin-ajax.php that will then trigger a PHP function that I have created using Code Snippets.

How on earth do you make an ajax call using Oxygen?

1

There are 1 answers

0
dcolumbus On

You know what, I just went ahead and added the action direction to the form using:

<form action="<?php echo admin_url( 'admin-ajax.php' ); ?>">

Don't have time to mess around with this anymore.