Support » Plugins and Hacks » [Resolved] Checkbox custom options checked by default

[Resolved] Checkbox custom options checked by default

  • Hello Pippin,

    i’m working on the extension of EDD, and some my custom checkbox options must be checked by default.

    There’s a default value options for many fields types, like text inputs or rich editors, but i couldn’t find something like this in


    this function. It will only checks fields that’s already been checked and are presented in $edd_options, but i need it right from the plugin installation.

    What can i do about it?


Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Pippin Williamson


    I would suggest that you reverse what your checkbox does, so if the box is to “enable” something, swap it so that it “disables”.

    Our settings API is missing a few requirements that would be needed to make this work.

    Ok, thank you very much.

    Do you plan to support this API feature someday, if i might ask?

    Another relevant question: is there a way to set up some options by default, i.e. in time of plugin’s installation?

    Can i something like that:

    function install_callback(){
        global $edd_options;
        if( !isset($edd_options['checkbox_opt']) )
            $edd_options['checkbox_opt'] = '1';
    register_activation_hook(MY_PLUGIN_FILE, 'install_callback');

    EDD is doing some default set ups like this, i’d presume, but i haven’t find it in the code yet. Am i right about this?

    Thanks in advance.

    Plugin Author Pippin Williamson


    Yes I would like to support it.

    Yes options can be setup during install, but you will be unable to hook into them via another plugin.

    Yes I would like to support it.

    – Thank you very much, it’d be useful! Can you also provide the default option feature for the rest of field types, that don’t have it already, like select dropdowns?

    Plugin Author Pippin Williamson


    It’s on the todo list.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Resolved] Checkbox custom options checked by default’ is closed to new replies.