Export User Info to CSV from Front End

Nevermind, I figured out a way to make it work. I just removed the need for a url altogether. Here’s what I did in case anybody else wants to know.

I changed the link to an form input button:

<form method="post">
    <input type="submit" name="bc_export" class="btn btn-export" value="Export Store List for '.$atts['value'].'" />
</form>

And changed the $_GET['action'] to a $_POST[]:

if ( isset($_POST["bc_export"])) {
    add_action( 'init', 'bc_export_function');
}

Leave a Comment