Hook:ipt_fsqm_hook_integration
Triggered when a submission is saved for the first time by a user and all predefined integrations have been processed.
Hook Uses
Accepts one argument, a reference to the IPT_FSQM_Form_Elements_Data
object.
[php]
/**
* Add into the integration execution hook
* To carry out our custom integration
*
* @param object $obj A reference to the IPT_FSQM_Form_Elements_Data object
*/
function fsqm_custom_integration( $obj ) {
// Get our custom integration settings
$settings = $obj->settings[‘integration’][‘custom’];
// Do the integration if necessary
if ( $settings[‘enabled’] == true && ” != $obj->data->email ) {
// Set the name
$name = ”;
$su_names = array();
if ( $obj->data->f_name != ” ) {
$su_names[] = $obj->data->f_name;
}
if ( $obj->data->l_name != ” ) {
$su_names[] = $obj->data->l_name;
}
if ( ! empty( $su_names ) ) {
$name = implode( ‘ ‘, $su_names );
}
// Set the email
$email = $obj->data->email;
// Set the referer
$referer = wp_get_referer();
// Now do something with the information
}
}
add_action( ‘ipt_fsqm_hook_integration’, ‘fsqm_custom_integration’, 10, 1 );
[/php]
Source
Located in classes/class-ipt-fsqm-form-elements-data.php
.
Filter: ipt_fsqm_integration_settings_tabs
The ipt_fsqm_integration_settings_tabs
is used to extend the vertical tabs inside the integration settings. It comes in handy when you are planning to extend the third party integration of eForm.
Filter Uses
The filter accepts two arguments (much like the ipt_fsqm_admin_tab_settings
). The first one is an associative array of tab settings and their callback. The second is the reference of IPT_FSQM_Form_Elements_Admin
class that has called this filter.
[php]
/**
* Sample usage of ipt_fsqm_integration_settings_tabs filter
*/
class FSQM_Extend_Integration {
protected $fsqm_admin_obj;
public function __construct() {
add_filter( ‘ipt_fsqm_integration_settings_tabs’, array( $this, ‘my_own_fsqm_settings’ ), 10, 2 );
}
function my_own_fsqm_settings( $tab_settings, $obj ) {
// Store the pointer to the object for later use
$this->fsqm_admin_obj = $obj;
// Modify the tab settings to add our own tab
$tab_settings[] = array(
‘id’ => ‘my_own_fsqm_settings_panel’, // HTML ID of the new settings tab
‘label’ => __( ‘Custom Settings’, ‘domain’ ), // Label of the tab
‘callback’ => array( $this, ‘settings_cb’ ), // Valid callback method/function
);
return $tab_settings;
}
public function settings_cb() {
// Get the options
$options = $this->fsqm_admin_obj->settings[‘integration’][‘custom’];
// Print your settings panel
}
}
$fsqm_settings = new FSQM_Extend_Integration();
[/php]
The return should be an associative array with valid elements as mentioned. Otherwise none of the integration settings would work.
Examples:
Source:
Located in classes/class-ipt-fsqm-form-elements-admin.php
.