| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Plugin Name: HappyForms |
| 5 |
* Plugin URI: https://happyforms.me |
| 6 |
* Description: Your friendly drag and drop contact form builder for creating contact forms, lead generation forms, feedback forms, quote forms, survey forms and more! |
| 7 |
* Author: The Theme Foundry |
| 8 |
* Version: 1.9.5 |
| 9 |
* Author URI: https://thethemefoundry.com |
| 10 |
* Upgrade URI: https://thethemefoundry.com |
| 11 |
*/ |
| 12 |
|
| 13 |
/** |
| 14 |
* The current version of the plugin. |
| 15 |
*/ |
| 16 |
define( 'HAPPYFORMS_VERSION', '1.9.5' ); |
| 17 |
define( 'HAPPYFORMS_TEXT_DOMAIN', 'happyforms' ); |
| 18 |
|
| 19 |
if ( ! function_exists( 'happyforms_plugin_file' ) ): |
| 20 |
/** |
| 21 |
* Get the absolute path to the plugin file. |
| 22 |
* |
| 23 |
* @return string Absolute path to the plugin file. |
| 24 |
*/ |
| 25 |
function happyforms_plugin_file() { |
| 26 |
return __FILE__; |
| 27 |
} |
| 28 |
|
| 29 |
endif; |
| 30 |
|
| 31 |
if ( ! function_exists( 'happyforms_plugin_name' ) ): |
| 32 |
/** |
| 33 |
* Get the plugin basename. |
| 34 |
* |
| 35 |
* @return string The plugin basename. |
| 36 |
*/ |
| 37 |
function happyforms_plugin_name() { |
| 38 |
return plugin_basename( __FILE__ ); |
| 39 |
} |
| 40 |
|
| 41 |
endif; |
| 42 |
|
| 43 |
if ( ! function_exists( 'happyforms_get_plugin_url' ) ): |
| 44 |
/** |
| 45 |
* Get the plugin url. |
| 46 |
* |
| 47 |
* @return string The url of the plugin. |
| 48 |
*/ |
| 49 |
function happyforms_get_plugin_url() { |
| 50 |
return plugin_dir_url( __FILE__ ); |
| 51 |
} |
| 52 |
|
| 53 |
endif; |
| 54 |
|
| 55 |
if ( ! function_exists( 'happyforms_get_plugin_path' ) ): |
| 56 |
/** |
| 57 |
* Get the absolute path of the plugin folder. |
| 58 |
* |
| 59 |
* @return string The absolute path of the plugin folder. |
| 60 |
*/ |
| 61 |
function happyforms_get_plugin_path() { |
| 62 |
return plugin_dir_path( __FILE__ ); |
| 63 |
} |
| 64 |
|
| 65 |
endif; |
| 66 |
|
| 67 |
if ( ! function_exists( 'happyforms_get_include_folder' ) ): |
| 68 |
/** |
| 69 |
* Get the path of the PHP include folder. |
| 70 |
* |
| 71 |
* @return string The path of the PHP include folder. |
| 72 |
*/ |
| 73 |
function happyforms_get_include_folder() { |
| 74 |
return dirname( __FILE__ ) . '/inc'; |
| 75 |
} |
| 76 |
|
| 77 |
endif; |
| 78 |
|
| 79 |
if ( ! function_exists( 'happyforms_get_core_folder' ) ): |
| 80 |
|
| 81 |
function happyforms_get_core_folder() { |
| 82 |
return dirname( __FILE__ ) . '/core'; |
| 83 |
} |
| 84 |
|
| 85 |
endif; |
| 86 |
|
| 87 |
/** |
| 88 |
* Activate |
| 89 |
*/ |
| 90 |
require_once( happyforms_get_core_folder() . '/helpers/helper-activation.php' ); |
| 91 |
|
| 92 |
/** |
| 93 |
* Core |
| 94 |
*/ |
| 95 |
require_once( happyforms_get_core_folder() . '/classes/class-happyforms-core.php' ); |
| 96 |
|
| 97 |
require_once( happyforms_get_include_folder() . '/classes/class-happyforms.php' ); |
| 98 |
|
| 99 |
/** |
| 100 |
* Helpers |
| 101 |
*/ |
| 102 |
require_once( happyforms_get_include_folder() . '/helpers/helper-activation.php' ); |
| 103 |
|
| 104 |
/** |
| 105 |
* Main handler |
| 106 |
*/ |
| 107 |
if ( ! function_exists( 'HappyForms' ) ): |
| 108 |
/** |
| 109 |
* Get the global HappyForms class. |
| 110 |
* |
| 111 |
* @return HappyForms |
| 112 |
*/ |
| 113 |
function HappyForms() { |
| 114 |
global $happyforms; |
| 115 |
|
| 116 |
if ( is_null( $happyforms ) ) { |
| 117 |
$happyforms = new HappyForms(); |
| 118 |
} |
| 119 |
|
| 120 |
return $happyforms; |
| 121 |
} |
| 122 |
|
| 123 |
endif; |
| 124 |
|
| 125 |
/** |
| 126 |
* Start general admin and frontend hooks. |
| 127 |
*/ |
| 128 |
add_action( 'plugins_loaded', array( HappyForms(), 'initialize_plugin' ) ); |
| 129 |
|
| 130 |
/** |
| 131 |
* Start Customize screen specific hooks. |
| 132 |
*/ |
| 133 |
add_filter( 'customize_loaded_components', array( HappyForms(), 'initialize_customize_screen' ) ); |
| 134 |
|