-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgf-shortcode-builder.php
More file actions
58 lines (48 loc) · 1.69 KB
/
gf-shortcode-builder.php
File metadata and controls
58 lines (48 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
/**
* Plugin Name: Gravity Forms Shortcode Builder
* Plugin URI: https://github.com/guilamu/gravity-forms-shortcode-builder
* Description: Adds a tool in Form Settings to easily build various Gravity Forms shortcodes. Compatible with GF Advanced Conditional Shortcodes by GravityWiz.
* Version: 1.5.0
* Author: Guilamu
* Author URI: https://github.com/guilamu
* Text Domain: gf-shortcode-builder
* Domain Path: /languages
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Requires at least: 5.8
* Requires PHP: 7.4
* Update URI: https://github.com/guilamu/gravity-forms-shortcode-builder/
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Bail if another copy of this plugin already loaded its constants.
if ( defined( 'GFSB_VERSION' ) ) {
return;
}
// Define plugin constants.
define( 'GFSB_VERSION', '1.5.0' );
define( 'GFSB_FILE', __FILE__ );
define( 'GFSB_PATH', plugin_dir_path( __FILE__ ) );
define( 'GFSB_URL', plugin_dir_url( __FILE__ ) );
// Autoloader
spl_autoload_register( function( $class ) {
$prefix = 'GFSB\\';
$base_dir = GFSB_PATH . 'includes/';
$len = strlen( $prefix );
if ( strncmp( $prefix, $class, $len ) !== 0 ) {
return;
}
$relative_class = substr( $class, $len );
$file = $base_dir . str_replace( '\\', '/', $relative_class ) . '.php';
if ( file_exists( $file ) ) {
require_once $file;
}
} );
use GFSB\Plugin;
// GitHub auto-updater.
require_once __DIR__ . '/includes/class-github-updater.php';
GFSB_GitHub_Updater::init();
add_action( 'plugins_loaded', [ Plugin::class, 'maybe_load_for_ajax' ], 11 );
add_action( 'gform_loaded', [ Plugin::class, 'get_instance' ] );