-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.php
More file actions
81 lines (65 loc) · 2.26 KB
/
bootstrap.php
File metadata and controls
81 lines (65 loc) · 2.26 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
/**
* Plugin Name: Gravity Forms Slideshow
* Description: Allows users to contribute to a slideshow by uploading pictures through Gravity Forms form. User uploaded pictures are added to the Media Library and can be used just like any other media file.
*
* Plugin URI: https://github.com/ForwardJumpMarketingLLC/GravityForms-slideshow
* GitHub Plugin URI: https://github.com/ForwardJumpMarketingLLC/GravityForms-slideshow
* GitHub Branch: master
* Author: ForwardJump Marketing, LLC
* Author URI: https://forwardjump.com
* Text Domain: gf-slideshow
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Version: 1.2.1
*/
namespace ForwardJump\GravityFormsSlideshow;
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
if ( ! defined( 'FJ_GRAVITYFORMS_SLIDESHOW_PLUGIN' ) ) {
define( 'FJ_GRAVITYFORMS_SLIDESHOW_PLUGIN', __FILE__ );
}
if ( ! defined( 'FJ_GRAVITYFORMS_SLIDESHOW_DIR' ) ) {
define( 'FJ_GRAVITYFORMS_SLIDESHOW_DIR', plugin_dir_path( __FILE__ ) );
}
if ( ! defined( 'FJ_GRAVITYFORMS_SLIDESHOW_URL' ) ) {
define( 'FJ_GRAVITYFORMS_SLIDESHOW_URL', plugin_dir_url( __FILE__ ) );
}
if ( ! defined( 'FJ_GRAVITYFORMS_SLIDESHOW_VERSION' ) ) {
define( 'FJ_GRAVITYFORMS_SLIDESHOW_VERSION', '1.2.1' );
}
if ( file_exists( FJ_GRAVITYFORMS_SLIDESHOW_DIR . 'vendor/CMB2/init.php' ) ) {
require_once FJ_GRAVITYFORMS_SLIDESHOW_DIR . 'vendor/CMB2/init.php';
}
/**
* Autoloads plugin files
*/
function autoload() {
$files = array(
'enqueue-assets',
'class-admin-options',
'admin',
'image-upload-handler',
'shortcodes',
);
foreach ( $files as $file ) {
include_once FJ_GRAVITYFORMS_SLIDESHOW_DIR . 'src/' . $file . '.php';
}
}
add_action( 'plugins_loaded', __NAMESPACE__ . '\plugin_init' );
/**
* Load plugin files if Gravity Forms is active. Deactivates with an admin warning if Gravity Forms is not active.
*
* @return void
*/
function plugin_init() {
if ( ! class_exists( 'GFForms' ) ) {
include_once FJ_GRAVITYFORMS_SLIDESHOW_DIR . 'src/admin.php';
add_action( 'admin_notices', __NAMESPACE__ . '\Admin\activation_error_notice' );
add_action( 'admin_init', __NAMESPACE__ . '\Admin\deactivate_self' );
return;
}
autoload();
}