-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add strong testimonials integration. #442
- Loading branch information
1 parent
d760da7
commit 1abf42c
Showing
6 changed files
with
71 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
integrations/strong-testimonials/class-strong-testimonials.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
|
||
defined( 'ABSPATH' ) or exit; | ||
|
||
/** | ||
* Class MC4WP_Strong_Testimonials_Integration | ||
* @ignore | ||
*/ | ||
class MC4WP_Strong_Testimonials_Integration extends MC4WP_Integration { | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $name = "Strong Testimonials"; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $description = "Subscribes people from a Strong Testimonials form."; | ||
|
||
/** | ||
* Add hooks | ||
*/ | ||
public function add_hooks() { | ||
|
||
if( ! $this->options['implicit'] ) { | ||
add_action( 'wpmtst_mc4wp', array( $this, 'output_checkbox' ), 90 ); | ||
} | ||
|
||
// hooks for checking if we should subscribe the commenter | ||
add_action( 'wpmtst_form_submission', array( $this, 'subscribe_from_strong_testimonials' ), 40 ); | ||
} | ||
|
||
/** | ||
* Grabs data from WP Comment Form | ||
* | ||
* @param int $comment_id | ||
* @param string $comment_approved | ||
* | ||
* @return bool|string | ||
*/ | ||
public function subscribe_from_strong_testimonials() { | ||
|
||
// was sign-up checkbox checked? | ||
if ( ! $this->triggered() ) { | ||
return false; | ||
} | ||
|
||
$data = array( | ||
'EMAIL' => $_POST['email'], | ||
'NAME' => ! empty( $_POST['client_name'] ) ? $_POST['client_name'] : '', | ||
); | ||
|
||
return $this->subscribe( $data ); | ||
} | ||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function is_installed() { | ||
return class_exists( 'Strong_Testimonials', false ); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters