setup_hooks();
}
/**
* Setup Hooks.
*
* @since 2.1
*
* @return void
*/
private function setup_hooks() {
if ( ! $this->is_donations_export_page() ) {
return;
}
// Do not render main export tools page.
remove_action(
'give_admin_field_tools_export',
[
'Give_Settings_Export',
'render_export_field',
],
10
);
// Render donation export page
add_action( 'give_admin_field_tools_export', [ $this, 'render_page' ] );
// Print the HTML.
add_action( 'give_tools_export_donations_form_start', [ $this, 'html' ] );
}
/**
* Filter to modify the Taxonomy args
*
* @since 2.1
*
* @param array $args args for Taxonomy
*
* @return array args for Taxonomy
*/
function give_forms_taxonomy_dropdown( $args ) {
$args['number'] = 30;
return $args;
}
/**
* Print the HTML for core setting exporter.
*
* @since 2.1
*/
public function html() {
?>
|
|
|
|
html->category_dropdown(
'give_forms_categories[]',
0,
[
'id' => 'give_forms_categories',
'class' => 'give_forms_categories',
'chosen' => true,
'multiple' => true,
'selected' => [],
'show_option_all' => false,
'placeholder' => __( 'Choose one or more from categories', 'give' ),
'data' => [ 'search-type' => 'categories' ],
]
);
?>
|
|
|
html->tags_dropdown(
'give_forms_tags[]',
0,
[
'id' => 'give_forms_tags',
'class' => 'give_forms_tags',
'chosen' => true,
'multiple' => true,
'selected' => [],
'show_option_all' => false,
'placeholder' => __( 'Choose one or more from tags', 'give' ),
'data' => [ 'search-type' => 'tags' ],
]
);
?>
|
|
|
'forms',
'id' => 'give-payment-form-select',
'class' => 'give-width-25em',
'chosen' => true,
'placeholder' => __( 'All Forms', 'give' ),
'data' => [ 'no-form' => __( 'No donation forms found', 'give' ) ],
];
echo Give()->html->forms_dropdown( $args );
?>
|
|
|
'give-payment-export-start',
'name' => 'start',
'placeholder' => __( 'Start Date', 'give' ),
'autocomplete' => 'off',
];
echo Give()->html->date_field( $args );
?>
'give-payment-export-end',
'name' => 'end',
'placeholder' => __( 'End Date', 'give' ),
'autocomplete' => 'off',
];
echo Give()->html->date_field( $args );
?>
|
|
|
|
|
|
|
exporter_type === give_clean( $_GET['type'] );
}
}
Give_Export_Donations::get_instance()->setup();
}