Skip to content

Instantly share code, notes, and snippets.

@kjohnson
Last active May 24, 2016 18:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kjohnson/ebb842c7b7b6101549e9cc2586b6b8e1 to your computer and use it in GitHub Desktop.
Save kjohnson/ebb842c7b7b6101549e9cc2586b6b8e1 to your computer and use it in GitHub Desktop.
<?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