Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
add_filter( 'ninja_forms_upgrade_settings', 'convert_form_settings_to_action' );
function convert_form_settings_to_action( $form_data ){
if( isset( $data[ 'settings' ][ 'my_processing_flag' ] ) && 1 == $data[ 'settings' ][ 'my_processing_flag' ] ){
$new_action = array(
'type' => 'action_type',
'label' => __( 'My Action', 'ninja-forms-paypal-express' ),
'new_setting' => $data[ 'settings' ][ 'old_plugin_setting' ]
);
$form_data[ 'actions' ][] = $new_action;
}
return $form_data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment