• Resolved lcapronnier

    (@lcapronnier)


    Hi

    I use the ‘cptch_forms_list’ filter to add an option in the admin panel. The new option is well displayed, no problem with that.

    But there is no code to save this new option to the database and no hook to do it by myself.

    Have you plan to add this feature ?

    Regards

    https://wordpress.org/plugins/captcha/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi,

    We have received your query and it is now being processed. We will get back to you on this forum as soon as we can.

    Regards,
    BestWebSoft Support Team

    Hi lcapronnier,

    It is not entirely clear to us, what you are trying to achieve. Thus, we kindly ask you to describe your issue with maximum detail and specify, which is your target result, so that we could help you.

    Regards,
    BestWebSoft Support Team

    Thread Starter lcapronnier

    (@lcapronnier)

    Hi

    Just add this code to your functions.php

    function cptch_custom_listaddcustomform($var) {
    	global $cptch_options;
    	$form = '<label><input type="checkbox" name="cptch_custom_listaddcustomform" value="cptch_custom_listaddcustomform"';
    	if ( 1 == $cptch_options[ "cptch_custom_listaddcustomform" ]) {
    			$form .= '"checked=\"checked\""';
    	}
    	$form .= " />Custom Form Captcha</label><br />";
    	return $form;
    }
    add_filter('cptch_forms_list', 'cptch_custom_listaddcustomform',10,1);

    And a new option will appear in the admin panel of the captcha plugin, bellow the ‘ Contact form (powered by bestwebsoft.com) Download contact form’ option.

    This works perfectly. But now how to save the value of this option in the database, either in captcha options or in my personal set of options ?

    Regards

    Hi lcapronnier,

    1. To save your custom settings, please add the necessary code by yourself.
    For instance, in the current plugin version 4.0.7, in “cptch_settings_page”, you can paste the following code to line number 275:

    $cptch_request_options['cptch_custom_listaddcustomform'] = isset( $_REQUEST['cptch_custom_listaddcustomform'] ) ? 1 : 0;

    In this case, the settings will be saved in the plugins options. However, please note that these changes will be removed next time you update the plugin. For this matter, if you would like to use this method, it is best that you add the same code (which will go off when saving the options) to your ‘functions.php’ file.

    2. Also, it is necessary to fix the code of the function “cptch_custom_listaddcustomform”:

    $form .= ' checked="checked" ';.

    Regards,
    BestWebSoft Support Team

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Save additional options in admin panel’ is closed to new replies.