get_db(); $table_exists = $db->table_exists(); $has_logs = $table_exists && $db->count() > 0; // Build base URL for exports. $base_url = admin_url( 'admin-ajax.php' ); // Current filter params for filtered export. $filter_params = array( 'action' => 'charitable_export_logs_csv', 'nonce' => $nonce, 'log_type' => isset( $_GET['log_type'] ) ? sanitize_key( $_GET['log_type'] ) : '', // phpcs:ignore WordPress.Security.NonceVerification.Recommended 'log_level' => isset( $_GET['log_level'] ) ? sanitize_key( $_GET['log_level'] ) : '', // phpcs:ignore WordPress.Security.NonceVerification.Recommended 'log_source' => isset( $_GET['log_source'] ) ? sanitize_key( $_GET['log_source'] ) : '', // phpcs:ignore WordPress.Security.NonceVerification.Recommended 's' => isset( $_GET['s'] ) ? sanitize_text_field( wp_unslash( $_GET['s'] ) ) : '', // phpcs:ignore WordPress.Security.NonceVerification.Recommended ); $export_filtered_url = add_query_arg( $filter_params, $base_url ); $export_all_url = add_query_arg( array( 'action' => 'charitable_export_logs_csv', 'nonce' => $nonce, 'export_all' => '1', ), $base_url ); ?>

prepare_items(); $list_table->search_box( __( 'Search Logs', 'charitable' ), 'charitable-logs' ); $list_table->display(); ?>