WP Hooks
-
Can I use this plugin to execute WordPress (and 3rd Party Plugin) actions and filters using php?
For example, executing a php snippet to process data when a gravity form is posted. Actions and filters are usually put in the functions.php file. I can create a php code block with the same code I would put in functions.php but it doesn’t get executed.
Example: The following code does not get executed when I add it as a php block in your plugin.
add_action( ‘gform_pre_submission_2’, ‘pre_submission_handler’ );
function pre_submission_handler( $form ) {
//Set Display Date
$event_date = rgpost( ‘input_8’ );
echo $event_date;
$display_date = DateTime::createFromFormat(‘m/d/Y’,$event_date)->format(‘F j, Y’);
echo $display_date;
$_POST[‘input_9’] = $display_date;
}
- The topic ‘WP Hooks’ is closed to new replies.