WordPress.org

Ready to get started?Download WordPress

Forums

Easy Digital Downloads
[resolved] Checkbox custom options checked by default (7 posts)

  1. Ahaenor
    Member
    Posted 1 year ago #

    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

    edd_checkbox_callback($args)

    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?

    http://wordpress.org/extend/plugins/easy-digital-downloads/

  2. 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.

  3. Ahaenor
    Member
    Posted 1 year ago #

    Ok, thank you very much.

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

  4. Ahaenor
    Member
    Posted 1 year ago #

    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.

  5. 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.

  6. Ahaenor
    Member
    Posted 1 year ago #

    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?

  7. It's on the todo list.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.