Filter: ipt_fsqm_up_filter_action_button
Used to add buttons inside user portal call to action section.
Filter Uses
Accepts two arguments. Please see source code below.
[php]
/**
* Add download button inside user portal
*
* @param array $buttons Associative array of button elements
* @param object $form Reference to the IPT_FSQM_Form_Elements_Data object
*
* @return array
*/
function fsqm_add_download_up( $buttons, $form ) {
// We add a download button
// inside action column of user portal
$buttons[] = array(
__( ‘Download PDF’, ‘domain’ ),
‘ipt_fsqm_report_download_’ . $form->form_id . ‘_’ . $form->data_id,
$size,
‘none’,
‘normal’,
array( ‘ipt_fsqm_download_submission’ ),
‘button’,
array(),
array(‘onclick’ => ‘javascript:window.location.href="’ . wp_nonce_url( admin_url( ‘admin-ajax.php?action=ipt_fsqm_exp_download_submission&id=’ . $form->data_id ), ‘ipt_fsqm_exp_download_sub_’ . $form->data_id ) . ‘"’),
”,
‘file-pdf’,
‘before’,
);
// But this would just add a button
// Actual functionality would still need to get implemented
return $buttons;
}
add_filter( ‘ipt_fsqm_up_filter_action_button’, ‘fsqm_add_download_up’, 10, 2 );
[/php]
Source
Located in classes/class-ipt-fsqm-form-elements-static.php
.
Filter: ipt_fsqm_filter_static_report_print
Used to add buttons to the trackback page.
Filter Uses
Accepts three parameters. Please see the source code below.
[php]
/**
* Add download button inside trackback
*
* @param array $buttons Associative array of button elements
* @param object $form Reference to the IPT_FSQM_Form_Elements_Front object
* @param bool $score Whether or not score is supposed to be shown
*
* @return array
*/
function fsqm_add_download_tb( $buttons, $form, $score ) {
// We add a download button
// inside action column of user portal
$buttons[] = array(
__( ‘Download PDF’, ‘domain’ ),
‘ipt_fsqm_report_download_’ . $form->form_id . ‘_’ . $form->data_id,
$size,
‘none’,
‘normal’,
array( ‘ipt_fsqm_download_submission’ ),
‘button’,
array(),
array(‘onclick’ => ‘javascript:window.location.href="’ . wp_nonce_url( admin_url( ‘admin-ajax.php?action=ipt_fsqm_exp_download_submission&id=’ . $form->data_id ), ‘ipt_fsqm_exp_download_sub_’ . $form->data_id ) . ‘"’),
”,
‘file-pdf’,
‘before’,
);
// But this would just add a button
// Actual functionality would still need to get implemented
return $buttons;
}
add_filter( ‘ipt_fsqm_filter_static_report_print’, ‘fsqm_add_download_tb’, 10, 3 );
[/php]
Source
Located in classes/class-ipt-fsqm-form-elements-static.php
.