PluginProbe
Hash Form – Drag & Drop Form Builder / 1.2.0
Hash Form – Drag & Drop Form Builder v1.2.0
1.4.4 1.4.3 1.4.2 1.4.1 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.6.1 1.2.7 1.2.8 1.2.9 1.3.0 All 47 releases
hash-form / hash-form.php

hash-form.php in Hash Form – Drag & Drop Form Builder 1.2.0, at hash-form.php

115 lines 3.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /*
4 * Plugin Name: Hash Form - Drag & Drop Form Builder
5 * Description: Design, Embed, Connect: Your Ultimate Form Companion for WordPress
6 * Version: 1.2.0
7 * Author: HashThemes
8 * Author URI: https://hashthemes.com/
9 * Text Domain: hash-form
10 * License: GPL-2.0+
11 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
12 * Domain Path: /languages
13 */
14
15
16 defined('ABSPATH') || die();
17
18 define('HASHFORM_VERSION', '1.2.0');
19 define('HASHFORM_FILE', __FILE__);
20 define('HASHFORM_PATH', plugin_dir_path(HASHFORM_FILE));
21 define('HASHFORM_URL', plugin_dir_url(HASHFORM_FILE));
22 define('HASHFORM_UPLOAD_DIR', '/hashform');
23
24 require HASHFORM_PATH . 'admin/classes/HashFormSerializedStrParser.php';
25 require HASHFORM_PATH . 'admin/classes/HashFormStrReader.php';
26 require HASHFORM_PATH . 'admin/classes/HashFormBlock.php';
27 require HASHFORM_PATH . 'admin/classes/HashFormUploader.php';
28 require HASHFORM_PATH . 'admin/classes/HashFormCreateTable.php';
29 require HASHFORM_PATH . 'admin/classes/HashFormBuilder.php';
30 require HASHFORM_PATH . 'admin/classes/HashFormHelper.php';
31 require HASHFORM_PATH . 'admin/classes/HashFormFields.php';
32 require HASHFORM_PATH . 'admin/classes/HashFormLoader.php';
33 require HASHFORM_PATH . 'admin/classes/HashFormSmtp.php';
34 require HASHFORM_PATH . 'admin/classes/HashFormEntry.php';
35 require HASHFORM_PATH . 'admin/classes/HashFormImportExport.php';
36 require HASHFORM_PATH . 'admin/classes/HashFormListing.php';
37 require HASHFORM_PATH . 'admin/classes/HashFormEntryListing.php';
38 require HASHFORM_PATH . 'admin/classes/HashFormValidate.php';
39 require HASHFORM_PATH . 'admin/classes/HashFormPreview.php';
40 require HASHFORM_PATH . 'admin/classes/HashFormShortcode.php';
41 require HASHFORM_PATH . 'admin/classes/HashFormSettings.php';
42 require HASHFORM_PATH . 'admin/classes/HashFormStyles.php';
43 require HASHFORM_PATH . 'admin/classes/HashFormGridHelper.php';
44 require HASHFORM_PATH . 'admin/classes/HashFormEmail.php';
45
46 /**
47 * Register widget.
48 */
49 add_action('elementor/widgets/register', 'hashform_elementor_widget_register');
50
51 function hashform_elementor_widget_register($widgets_manager) {
52 require HASHFORM_PATH . 'admin/classes/HashFormElement.php';
53 $widgets_manager->register(new \HashFormElement());
54 }
55
56 /**
57 * Plugin Activation.
58 */
59 register_activation_hook(HASHFORM_FILE, 'hashform_network_create_table');
60
61 function hashform_network_create_table($network_wide) {
62 global $wpdb;
63
64 if (is_multisite() && $network_wide) {
65 // Get all blogs in the network and activate plugin on each one
66 $blog_ids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
67 foreach ($blog_ids as $blog_id) {
68 switch_to_blog($blog_id);
69 $db = new HashFormCreateTable();
70 $db->upgrade();
71 restore_current_blog();
72 }
73 } else {
74 $db = new HashFormCreateTable();
75 $db->upgrade();
76 }
77 }
78
79 /**
80 * Create form tables on single site.
81 */
82 function hashform_create_table() {
83 $db = new HashFormCreateTable();
84 $db->upgrade();
85 }
86
87 /**
88 * Create form tables on multisite creation.
89 */
90 add_action('wp_insert_site', 'hashform_on_create_blog');
91
92 function hashform_on_create_blog($data) {
93 if (is_plugin_active_for_network('hash-form/hash-form.php')) {
94 switch_to_blog($data->blog_id);
95 $db = new HashFormCreateTable();
96 $db->upgrade();
97 restore_current_blog();
98 }
99 }
100
101 /**
102 * Drop form tables on multisite deletion.
103 */
104 add_filter('wpmu_drop_tables', 'hashform_on_delete_blog');
105
106 function hashform_on_delete_blog($tables) {
107 global $wpdb;
108 $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0;
109 $tables[] = $wpdb->get_blog_prefix($id) . 'hashform_fields';
110 $tables[] = $wpdb->get_blog_prefix($id) . 'hashform_forms';
111 $tables[] = $wpdb->get_blog_prefix($id) . 'hashform_entries';
112 $tables[] = $wpdb->get_blog_prefix($id) . 'hashform_entry_meta';
113 return $tables;
114 }
115