Skip to content

Commit

Permalink
add strong testimonials integration. #442
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyvankooten committed Jun 9, 2017
1 parent d760da7 commit 1abf42c
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 4 deletions.
1 change: 1 addition & 0 deletions integrations/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ function mc4wp_admin_after_integration_settings( MC4WP_Integration $integration,
mc4wp_register_integration( 'contact-form-7', 'MC4WP_Contact_Form_7_Integration', true );
mc4wp_register_integration( 'events-manager', 'MC4WP_Events_Manager_Integration' );
mc4wp_register_integration( 'memberpress', 'MC4WP_MemberPress_Integration' );
mc4wp_register_integration( 'strong-testimonials', 'MC4WP_Strong_Testimonials_Integration' );
mc4wp_register_integration( 'custom', 'MC4WP_Custom_Integration', true );
require dirname(__FILE__) . '/ninja-forms/bootstrap.php';

Expand Down
64 changes: 64 additions & 0 deletions integrations/strong-testimonials/class-strong-testimonials.php
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 );
}

}
2 changes: 1 addition & 1 deletion vendor/autoload_52.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';

return ComposerAutoloaderInit4dc707105fc640cf229f5c568acd354f::getLoader();
return ComposerAutoloaderInitc648a6850949636b639b944f72ef148b::getLoader();
1 change: 1 addition & 0 deletions vendor/composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
'MC4WP_Queue_Job' => $baseDir . '/includes/class-queue-job.php',
'MC4WP_Registration_Form_Integration' => $baseDir . '/integrations/wp-registration-form/class-registration-form.php',
'MC4WP_Request' => $baseDir . '/includes/class-request.php',
'MC4WP_Strong_Testimonials_Integration' => $baseDir . '/integrations/strong-testimonials/class-strong-testimonials.php',
'MC4WP_Tools' => $baseDir . '/includes/class-tools.php',
'MC4WP_Update_Optin' => $baseDir . '/includes/admin/class-update-optin.php',
'MC4WP_Upgrade_Routines' => $baseDir . '/includes/admin/class-upgrade-routines.php',
Expand Down
6 changes: 3 additions & 3 deletions vendor/composer/autoload_real_52.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_real_52.php generated by xrstf/composer-php52

class ComposerAutoloaderInit4dc707105fc640cf229f5c568acd354f {
class ComposerAutoloaderInitc648a6850949636b639b944f72ef148b {
private static $loader;

public static function loadClassLoader($class) {
Expand All @@ -19,9 +19,9 @@ public static function getLoader() {
return self::$loader;
}

spl_autoload_register(array('ComposerAutoloaderInit4dc707105fc640cf229f5c568acd354f', 'loadClassLoader'), true /*, true */);
spl_autoload_register(array('ComposerAutoloaderInitc648a6850949636b639b944f72ef148b', 'loadClassLoader'), true /*, true */);
self::$loader = $loader = new xrstf_Composer52_ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit4dc707105fc640cf229f5c568acd354f', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitc648a6850949636b639b944f72ef148b', 'loadClassLoader'));

$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
Expand Down
1 change: 1 addition & 0 deletions vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class ComposerStaticInitc16a50fb3cb50a786a944e8e9cbf2f72
'MC4WP_Queue_Job' => __DIR__ . '/../..' . '/includes/class-queue-job.php',
'MC4WP_Registration_Form_Integration' => __DIR__ . '/../..' . '/integrations/wp-registration-form/class-registration-form.php',
'MC4WP_Request' => __DIR__ . '/../..' . '/includes/class-request.php',
'MC4WP_Strong_Testimonials_Integration' => __DIR__ . '/../..' . '/integrations/strong-testimonials/class-strong-testimonials.php',
'MC4WP_Tools' => __DIR__ . '/../..' . '/includes/class-tools.php',
'MC4WP_Update_Optin' => __DIR__ . '/../..' . '/includes/admin/class-update-optin.php',
'MC4WP_Upgrade_Routines' => __DIR__ . '/../..' . '/includes/admin/class-upgrade-routines.php',
Expand Down

0 comments on commit 1abf42c

Please sign in to comment.