Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

POST-PROCESS RUN ACTION

$
0
0

Replies: 0

I use the run action to execute a function in a custom plugin that I created for this form. The purpose, to format the form information for an HTTP POST to a remote API.
$result = file_get_contents($url, false, $context);

If that $result === FALSE or the $result contains a failure message, I want to return to the form with an informative message for the user.
“!! An error has occured. Please, try again later.”

However, a return array(‘error’ => TRUE, ‘note’ => “!! An error has occured. Please, try again later.” );

Does not work.
I’m thinking that the run action does not accept a value upon return.
Eh? Any ideas?


Viewing all articles
Browse latest Browse all 59525

Trending Articles