• Resolved bcxdeveloper

    (@bcxdeveloper)


    First off, thank you for this plugin!! It was exactly what I was looking for. It is very easy to use.
    My question: Is there a way to enable the download url by default or a way to ignore whether or not the download is enabled for a specific form through the shortcode. I run a site where ALL forms will need to be downloaded individually, it would be a great time saver to not need to go into every form and enable downloading for each.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Doeke Norg

    (@doekenorg)

    @bcxdeveloper You are most welcome. Always glad to hear people like it 🙂

    I’ve purposely disabled this option by default. Because of potential security risks. What if someone never intended for a form to have a public download link? So I’ve made it opt-in.

    But if you know exactly what you are doing, and I assume you do 😉 You can use this tiny piece of code in your functions.php to enable it when you create a form. So this isn’t default for every form you’ve added in the past, but for every one you create from here on.

    Hope this helps you out.

    /**
     * Enable GF Entries in Excel for new forms by default.
     */
    add_action('gform_after_save_form', static function (array $form, bool $is_new) {
        if ($is_new && class_exists('GFExcel\GFExcel')) {
            GFExcel::setHash($form['id']);
        }
    }, 10, 2);
    Thread Starter bcxdeveloper

    (@bcxdeveloper)

    @doekenorg Excellent!! Thank you so much!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Enable Download by Default’ is closed to new replies.