• In your front-end sample the $_GET calls the init-hook, this makes it harder for developers to add own code, because a lot of woocommerce functions etc. are not loaded yet. Changing init to template_redirect helped me be able to manipulate the arrays the way I wanted.

    
    if(isset($_GET['csv_export_button'])) {
      add_action('template_redirect', function(){

    In addition I changed one of the bottom lines in csvdownload.php to make the delimiter EU-friendly:
    fputcsv($outstream, $result, $delimiter = ';');

The topic ‘Suggested change hooks: init-> template redirect’ is closed to new replies.