Add GF section to settings page
This commit is contained in:
@@ -12,6 +12,7 @@ namespace Ogre\Captcha;
|
|||||||
|
|
||||||
use Ogre\Singleton;
|
use Ogre\Singleton;
|
||||||
use Ogre\Captcha as Plugin;
|
use Ogre\Captcha as Plugin;
|
||||||
|
use Ogre\Captcha\GravityForms\Addon;
|
||||||
|
|
||||||
defined('ABSPATH') || exit;
|
defined('ABSPATH') || exit;
|
||||||
|
|
||||||
@@ -378,6 +379,21 @@ final class Settings {
|
|||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (Plugin::is_gravityforms_active() && class_exists('Ogre\Captcha\GravityForms\Addon')) {
|
||||||
|
add_settings_section(
|
||||||
|
'gravityforms',
|
||||||
|
Plugin::__('Gravity Forms'),
|
||||||
|
[$this, 'section'],
|
||||||
|
Plugin::get_id(),
|
||||||
|
[
|
||||||
|
'description' => sprintf(
|
||||||
|
Plugin::__('The configuration of Ogre CAPTCHA\'s Gravityforms integration can be found on <a href="%s">this page</a> and within the settings of each form.'),
|
||||||
|
esc_url(Addon::get_instance()->get_url())
|
||||||
|
),
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -177,4 +177,14 @@ final class Addon extends GFAddOn {
|
|||||||
return $links;
|
return $links;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function get_url(): string {
|
||||||
|
return add_query_arg(
|
||||||
|
[
|
||||||
|
'page' => 'gf_settings',
|
||||||
|
'subview' => $this->get_slug()
|
||||||
|
],
|
||||||
|
admin_url('admin.php')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user