|
| 1 | +<?php |
| 2 | + |
| 3 | +// don't load directly |
| 4 | +if ( ! defined( 'ABSPATH' ) ) { |
| 5 | + die(); |
| 6 | +} |
| 7 | + |
| 8 | +/** |
| 9 | +Plugin Name: Gravity Forms Batchbook Add-On |
| 10 | +Plugin URI: https://www.gravityforms.com |
| 11 | +Description: Integrates Gravity Forms with Batchbook, allowing form submissions to be automatically sent to your Batchbook account. |
| 12 | +Version: 1.3 |
| 13 | +Author: rocketgenius |
| 14 | +Author URI: https://www.rocketgenius.com |
| 15 | +License: GPL-2.0+ |
| 16 | +Text Domain: gravityformsbatchbook |
| 17 | +Domain Path: /languages |
| 18 | +
|
| 19 | +------------------------------------------------------------------------ |
| 20 | +Copyright 2009 rocketgenius |
| 21 | +last updated: October 20, 2010 |
| 22 | +
|
| 23 | +This program is free software; you can redistribute it and/or modify |
| 24 | +it under the terms of the GNU General Public License as published by |
| 25 | +the Free Software Foundation; either version 2 of the License, or |
| 26 | +(at your option) any later version. |
| 27 | +
|
| 28 | +This program is distributed in the hope that it will be useful, |
| 29 | +but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 30 | +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 31 | +GNU General Public License for more details. |
| 32 | +
|
| 33 | +You should have received a copy of the GNU General Public License |
| 34 | +along with this program; if not, write to the Free Software |
| 35 | +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 36 | + **/ |
| 37 | + |
| 38 | +define( 'GF_BATCHBOOK_VERSION', '1.3' ); |
| 39 | + |
| 40 | +// If Gravity Forms is loaded, bootstrap the Batchbook Add-On. |
| 41 | +add_action( 'gform_loaded', array( 'GF_Batchbook_Bootstrap', 'load' ), 5 ); |
| 42 | + |
| 43 | +/** |
| 44 | + * Class GF_Batchbook_Bootstrap |
| 45 | + * |
| 46 | + * Handles the loading of the Batchbook Add-On and registers with the Add-On Framework. |
| 47 | + */ |
| 48 | +class GF_Batchbook_Bootstrap { |
| 49 | + |
| 50 | + /** |
| 51 | + * If the Feed Add-On Framework exists, Batchbook Add-On is loaded. |
| 52 | + * |
| 53 | + * @access public |
| 54 | + * @static |
| 55 | + */ |
| 56 | + public static function load() { |
| 57 | + |
| 58 | + if ( ! method_exists( 'GFForms', 'include_feed_addon_framework' ) ) { |
| 59 | + return; |
| 60 | + } |
| 61 | + |
| 62 | + require_once( 'class-gf-batchbook.php' ); |
| 63 | + |
| 64 | + GFAddOn::register( 'GFBatchbook' ); |
| 65 | + |
| 66 | + } |
| 67 | + |
| 68 | +} |
| 69 | + |
| 70 | +/** |
| 71 | + * Returns an instance of the GFBatchbook class |
| 72 | + * |
| 73 | + * @see GFBatchbook::get_instance() |
| 74 | + * |
| 75 | + * @return object GFBatchbook |
| 76 | + */ |
| 77 | +function gf_batchbook() { |
| 78 | + return GFBatchbook::get_instance(); |
| 79 | +} |
0 commit comments