Skip to content

Instantly share code, notes, and snippets.

@ajmorris
Created April 15, 2014 21:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajmorris/10775568 to your computer and use it in GitHub Desktop.
Save ajmorris/10775568 to your computer and use it in GitHub Desktop.
GFHubSpotAddon
<?php
/**
* Plugin Name.
*
* @package GF HubSpot Add-On
* @author AJ Morris
* @license GPL-2.0+
* @link http://example.com
* @copyright 2013 Your Name or Company Name
*
* @wordpress-plugin
* Plugin Name: GF HubSpot Add-On
* Plugin URI: http://covenanteyes.com
* Description: A connector between Gravity Forms and HubSpot
* Version: 0.0.1
* Author: AJ Morris
* Author URI: http://ajmorris.me
* Text Domain: plugin-name-locale
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Domain Path: /languages
*/
if (class_exists("GFForms")) {
GFForms::include_addon_framework();
class GFHubSpotAddOn extends GFAddOn {
protected $_version = "1.0";
protected $_min_gravity_forms_version = "1.8";
protected $_slug = "gfhubspotaddon";
protected $_path = "gfhubspotaddon/gfhubspotaddon.php";
protected $_full_path = __FILE__;
protected $_url = "http://ajmorris.me";
protected $_title = "Gravity Forms HubSpot Add-On";
protected $_short_title = "HubSpot Add-On";
public function init(){
parent::init();
add_filter("gform_submit_button", array($this, "form_submit_button"), 10, 2);
}
public function plugin_page() {
?>
This page appears in the forms menu.
<?php
}
public function form_settings_fields($form) {
return array(
array(
"title" => "HubSpot Form Settings",
"fields" => array(
array(
"label" => "HubSpot Form URL",
"type" => "text",
"name" => "formurl",
"tooltip" => "This is the tooltip.",
)
)
)
);
}
public function plugin_settings_fields() {
return array(
array(
"title" => "HubSpot Add-On Settings",
"fields" => array(
array(
"label" => "HubSpot API Key",
"type" => "text",
"name" => "apikey",
"tooltip" => "This is the tooltip.",
)
)
)
);
}
}
new GFHubSpotAddOn();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment