• U have a little bug in your Plugin.

    Check the subscription checkbox by default <= This setting in the Adminsection will be ignored.

    It is always enabled!

    change your function from

    function cren_get_default_checked() {
        return cren_get_option('cren_subscription_check_by_default', true);
    }

    to

    function cren_get_default_checked() {
        return cren_get_option('cren_subscription_check_by_default', false);
    }

    Currently, the checkbox is always checked.

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

    (@guhemama)

    Nice catch! I will release a bug fix. ??

    Thread Starter soulevan

    (@soulevan)

    It was a simple workaround. In my opinion, the default values are not required. In the backend u can set the defaults after a installation. The user can change it or not, but the default_checked function is a little bit needless.

    This mean:

    function cren_get_option($option, $default) {
        $options = get_option('cren_settings');
    
        if ($options && isset($options[$option])) {
            return $options[$option];
        }
    
        return $default;
    }
    
    function cren_get_default_checked() {
        return cren_get_option('cren_subscription_check_by_default', false);
    }
    
    /**
     * Returns whether the GDPR checkbox should be shown or not.
     *
     * @return bool
     */
    function cren_display_gdpr_notice() {
        return cren_get_option('cren_display_gdpr_notice', false);
    }
    • This reply was modified 6 years, 3 months ago by soulevan.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Good and simple!’ is closed to new replies.