Captcha::options()

Description #

Register Categories options

Source #

File: addons/recaptcha/recaptcha.php

	public function options() {
		global $wp_roles;
		$opt = ap_opt();

		$roles = [];
		foreach ( $wp_roles->roles as $key => $role ) {
			$roles[ $key ] = $role['name'];
		}

		$form = array(
			'fields' => array(
				'recaptcha_site_key'   => array(
					'label' => __( 'Recaptcha site key', 'anspress-question-answer' ),
					'desc'  => __( 'Enter your site key, if you dont have it get it from here https://www.google.com/recaptcha/admin', 'anspress-question-answer' ),
					'value' => $opt['recaptcha_site_key'],
				),
				'recaptcha_secret_key' => array(
					'label' => __( 'Recaptcha secret key', 'anspress-question-answer' ),
					'desc'  => __( 'Enter your secret key', 'anspress-question-answer' ),
					'value' => $opt['recaptcha_secret_key'],
				),
				'recaptcha_method' => array(
					'label'   => __( 'Recaptcha Method', 'anspress-question-answer' ),
					'desc'    => __( 'Select method to use when verification keeps failing', 'anspress-question-answer' ),
					'type'    => 'select',
					'options' => array(
						'curl' => 'CURL',
						'post' => 'POST',
					),
					'value'   => $opt['recaptcha_method'],
				),
				'recaptcha_exclude_roles' => array(
					'label'   => __( 'Hide reCaptcha for roles', 'anspress-question-answer' ),
					'desc'    => __( 'Select roles for which reCaptcha will be hidden.', 'anspress-question-answer' ),
					'type'    => 'checkbox',
					'options' => $roles,
					'value'   => $opt['recaptcha_exclude_roles'],
				),
			),
		);

		return $form;
	}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment