Skip to content

Commit

Permalink
Add Extra theme integration
Browse files Browse the repository at this point in the history
  • Loading branch information
kagg-design committed Nov 25, 2024
1 parent 04e647d commit ff68b3a
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 2 deletions.
24 changes: 24 additions & 0 deletions assets/images/logo/extra.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,7 @@ If this feature is enabled, anonymized statistics on your plugin configuration,
* Elementor Pro Form and Login Form
* Essential Addons for Elementor Login and Register Forms
* Essential Blocks Form
* Extra Comment, Contact, Email Optin and Login Forms
* Fluent Forms
* Forminator Forms
* Formidable Forms
Expand Down Expand Up @@ -600,6 +601,7 @@ Instructions for popular native integrations are below:
* Added instant updating of the Contact Form 7 live form.
* Added hCaptcha display on the Mailchimp form preview.
* Added Maintenance Login Form integration.
* Added Extra theme integration.
* Added theme argument to the [hcaptcha] shortcode.
* Fixed deactivating of all themes by Ctrl+Click on the Integrations page.
* Fixed theme name display upon activation.
Expand Down
3 changes: 2 additions & 1 deletion src/php/Divi/Login.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ public function add_divi_captcha( $output, string $module_slug ) {
}

$hcaptcha = '';
$theme = strtolower( get_template() );

// Check the login status, because class is always loading when Divi theme is active.
if ( hcaptcha()->settings()->is( 'divi_status', 'login' ) ) {
if ( hcaptcha()->settings()->is( $theme . '_status', 'login' ) ) {
ob_start();

$this->add_captcha();
Expand Down
20 changes: 20 additions & 0 deletions src/php/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -1043,6 +1043,26 @@ public function load_modules(): void {
'essential-blocks/essential-blocks.php',
EssentialBlocks\Form::class,
],
'Extra Comment Form' => [
[ 'extra_status', 'comment' ],
'Extra',
[ Divi\Comment::class, WP\Comment::class ],
],
'Extra Contact Form' => [
[ 'extra_status', 'contact' ],
'Extra',
Divi\Contact::class,
],
'Extra Email Optin Form' => [
[ 'extra_status', 'email_optin' ],
'Extra',
Divi\EmailOptin::class,
],
'Extra Login Form' => [
[ 'extra_status', null ],
'Extra',
[ Divi\Login::class ],
],
'Fluent Forms' => [
[ 'fluent_status', 'form' ],
'fluentform/fluentform.php',
Expand Down
14 changes: 13 additions & 1 deletion src/php/Settings/Integrations.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ protected function init_hooks(): void {

/**
* After switch theme action.
* Do not allow redirect during Divi theme activation.
* Do not allow redirect during Avada and Divi theme activation.
*
* @return void
*/
Expand Down Expand Up @@ -345,6 +345,18 @@ public function init_form_fields(): void {
'form' => __( 'Form', 'hcaptcha-for-forms-and-more' ),
],
],
'extra_status' => [
'entity' => 'theme',
'label' => 'Extra',
'logo' => 'svg',
'type' => 'checkbox',
'options' => [
'comment' => __( 'Extra Comment Form', 'hcaptcha-for-forms-and-more' ),
'contact' => __( 'Extra Contact Form', 'hcaptcha-for-forms-and-more' ),
'email_optin' => __( 'Extra Email Optin Form', 'hcaptcha-for-forms-and-more' ),
'login' => __( 'Extra Login Form', 'hcaptcha-for-forms-and-more' ),
],
],
'fluent_status' => [
'label' => 'Fluent Forms',
'type' => 'checkbox',
Expand Down

0 comments on commit ff68b3a

Please sign in to comment.