Last active
May 24, 2016 18:24
-
-
Save kjohnson/ebb842c7b7b6101549e9cc2586b6b8e1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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