APIs on basic form & submission administrative actions

Hook: ipt_fsqm_forms_deleted

This is triggered when eForm is about to delete some forms from the system.

Hook Uses

The callback function accepts one parameter, an array of form ids that is about to get deleted.

/**
 * Hook use ipt_fsqm_forms_deleted
 */
function hook_into_forms_deleted( $ids ) {
	global $ipt_fsqm_info, $wpdb;

	$delete_ids = implode( ',', $ids );

	// Forms are still present in the database table
	// So you might want to do something with it
	$wpdb->get_results( "SELECT * FROM {$ipt_fsqm_info['form_table']} WHERE id IN ({$delete_ids})" );
}
add_action( 'ipt_fsqm_forms_deleted', 'hook_into_forms_deleted', 10, 1 );

Source

Located in classes/class-ipt-fsqm-form-elements-static.php.

Hook: ipt_fsqm_submissions_deleted

Triggered when eForm Submissions are about to be deleted from eForm data table.

Hook Uses

Callback function accepts one argument which is an array of ids of data table that is about to get deleted.

/**
 * Hook to use ipt_fsqm_submissions_deleted
 */
function hook_into_submissions_deleted( $ids ) {
	global $ipt_fsqm_info, $wpdb;

	$delete_ids = implode( ',', $ids );

	// Data are still present in the database table
	// So you might want to do something with it
	$wpdb->get_results( "SELECT * FROM {$ipt_fsqm_info['data_table']} WHERE id IN ({$delete_ids})" );
}
add_action( 'ipt_fsqm_submissions_deleted', 'hook_into_submissions_deleted', 10, 1 );

Source

Located in classes/class-ipt-fsqm-form-elements-static.php.

Hook: ipt_fsqm_form_updated

Triggers when a eForm form is being updated.

Hook Uses

The callback function can accept two arguments. First one is the database ID of the form that has just being updated. Second is a reference of IPT_FSQM_Form_Elements_Admin object that has triggered the hook. This object would contain variables from the previous version of the form.

/**
 * Hooks into ipt_fsqm_form_updated
 *
 * @param      integer  $form_id  The form ID that has been updated
 * @param      object   $obj      Reference to the parent object
 */
function hook_into_form_updated( $form_id, $obj ) {
	// Since $obj still holds older variables,
	// you might want to do something with it
	$older_form_structure = array(
		'name' => $obj->name,
		'settings' => maybe_serialize( $obj->settings ),
		'layout' => maybe_serialize( $obj->layout ),
		'design' => maybe_serialize( $obj->design ),
		'mcq' => maybe_serialize( $obj->mcq ),
		'freetype' => maybe_serialize( $obj->freetype ),
		'pinfo' => maybe_serialize( $obj->pinfo ),
		'type' => $obj->type,
		'category' => $obj->category,
	);
}
add_action( 'ipt_fsqm_form_updated', 'hook_into_form_updated', 10, 2 );

Source

Located in classes/class-ipt-fsqm-form-elements-admin.php.

Hook: ipt_fsqm_form_created

Triggers when a eForm form is being created.

Hook Uses

The callback function can accept two arguments. First one is the database ID of the form that has been created. Second is a reference of IPT_FSQM_Form_Elements_Admin object that has triggered this hook.

/**
 * Hooks into ipt_fsqm_form_created
 *
 * @param      integer  $form_id  ID of the form that has been created
 * @param      object   $obj      Reference to the parent object
 */
function hook_into_form_created( $form_id, $obj ) {
	global $ipt_fsqm_info, $wpdb;

	// Get the form
	$form = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$ipt_fsqm_info['form_table']} WHERE id = %d", $form_id ) );

	// Now do something with it
}
add_action( 'ipt_fsqm_form_created', 'hook_into_form_created', 10, 2 );

Hook: ipt_fsqm_hook_form_doing_admin_before

API-submission-admin

This is triggered when a submission is being edited from inside the admin panel.

Hook Uses

Callback function accepts one argument. It is the reference of the IPT_FSQM_Form_Elements_Front object that has called this trigger.

/**
 * Hooks into ipt_fsqm_hook_form_doing_admin_before
 *
 * @param      object  $obj    The reference of the IPT_FSQM_Form_Elements_Front object
 */
function hook_into_form_submission_admin( $obj ) {
	// Do something with the parent object
	?>

<div class="ui-widget-content ipt_uif_mother_wrap" style="margin-bottom: 20px">
	<?php $obj->ui->column_head( '', 'full', false ); ?>
	<?php $obj->ui->heading( __( 'Here comes a custom area', 'domain' ), 'h3', 'center', 'none' ); ?>
	<?php $obj->ui->column_tail(); ?>
</div>

	<?php
}
add_action( 'ipt_fsqm_hook_form_doing_admin_before', 'hook_into_form_submission_admin', 10, 1 );

Source

Located in classes/class-ipt-fsqm-form-elements-front.php.

Hook: ipt_fsqm_submissions_starred

Triggered right before submissions are being marked starred.

Hook Uses

Callback function accepts one argument which is an array of IDs of eForm data table submission records that are yet to be marked star.

/**
 * Hooks into ipt_fsqm_submissions_starred
 *
 * @param      array  $ids    Array of IDs of forms been starred
 */
function hook_into_sub_star( $ids ) {
	// Do something with $ids
}
add_action( 'ipt_fsqm_submissions_starred', 'hook_into_sub_star', 10, 1 );

Source

Located in classes/class-ipt-fsqm-form-elements-static.php.

Hook: ipt_fsqm_submissions_unstarred

Triggered right before submissions are being marked unstarred.

Hook Uses

Callback function accepts one argument which is an array of IDs of eForm data table submission records that are yet to be marked unstar.

/**
 * Hooks into ipt_fsqm_submissions_unstarred
 *
 * @param      array  $ids    Array of IDs of forms been unstarred
 */
function hook_into_sub_unstar( $ids ) {
	// Do something with $ids
}
add_action( 'ipt_fsqm_submissions_unstarred', 'hook_into_sub_star', 10, 1 );

Source

Located in classes/class-ipt-fsqm-form-elements-static.php.

Hook: ipt_fsqm_form_copied

Triggered after a form is being copied to make a duplicate.

Hook Uses

Callback accepts two arguments. First is the ID of the form that has been copied. Second is the ID of the duplicate form that has been pasted.

/**
 * Hooks into ipt_fsqm_form_copied
 *
 * @param      integer  $form_id      The original form ID
 * @param      integer  $dup_form_id  Duplicate form ID
 */
function hook_into_form_copied( $form_id, $dup_form_id ) {
	global $ipt_fsqm_info, $wpdb;

	// Get the form
	$form = new IPT_FSQM_Form_Elements_Admin( $dup_form_id );

	// Do something with the form
	// Sky is the limit

}
add_action( 'ipt_fsqm_form_copied', 'hook_into_form_copied', 10, 2 );

Source

Located in classes/class-ipt-fsqm-form-elements-static.php.

Hook: ipt_fsqm_form_category_created

Triggered when a form category is created.

Hook Uses

Callback accepts one argument, the ID of the category that has been created.

/**
 * Hooks into ipt_fsqm_form_category_created
 *
 * @param      integer  $cat_id  ID of the category that has been created
 */
function hook_into_cat_created( $cat_id ) {
	global $ipt_fsqm_info, $wpdb;
	// Do something with the cat ID
	$cat = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$ipt_fsqm_info['category_table']} WHERE id = %d", $cat_id ) );
}
add_action( 'ipt_fsqm_form_category_created', 'hook_into_cat_created', 10, 1 );

Source

Located in classes/class-ipt-fsqm-form-elements-static.php.

Hook: ipt_fsqm_form_category_updated

Triggered when a form category is updated.

Hook Uses

Callback accepts one argument, the ID of the category that has been updated.

/**
 * Hooks into ipt_fsqm_form_category_updated
 *
 * @param      integer  $cat_id  ID of the category that has been updated
 */
function hook_into_cat_updated( $cat_id ) {
	global $ipt_fsqm_info, $wpdb;
	// Do something with the cat ID
	$cat = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$ipt_fsqm_info['category_table']} WHERE id = %d", $cat_id ) );
}
add_action( 'ipt_fsqm_form_category_updated', 'hook_into_cat_updated', 10, 1 );

Source

Located in classes/class-ipt-fsqm-form-elements-static.php.

Hook: ipt_fsqm_form_category_deleted

Triggered when a form one or more categories are deleted.

Hook Uses

Callback accepts one argument, an array of IDs of categories been deleted. This is triggered before the deletion of categories.

/**
 * Hooks into ipt_fsqm_form_category_deleted
 *
 * @param      array  $cat_ids  Array of IDs of categories been deleted
 */
function hook_into_cat_deleted( $cat_ids ) {
	// Do something with $cat_ids
}
add_action( 'ipt_fsqm_form_category_deleted', 'hook_into_cat_deleted', 10, 1 );

Source

Located in classes/class-ipt-fsqm-form-elements-static.php.

Swashata has written 247 articles

Hi there, I am the Lead Developer at WPQuark.com. I love to create something beautiful for WordPress and here I write about how to use them. When I am not working, usually I am doing a number of other creative things ;).