-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplugin.php
92 lines (81 loc) · 2.82 KB
/
plugin.php
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
82
83
84
85
86
87
88
89
90
91
92
<?php namespace WPDC_Sticky_Footer;
/**
* WP Developers Club Sticky Footer
*
* @package WPDC_Sticky_Footer
* @author WPDevelopersClub and hellofromTonya
* @license GPL-2.0+
* @link https://wpdevelopersclub.com/
* @copyright 2015 WP Developers Club
*
* @wordpress-plugin
* Plugin Name: WP Developers Club Sticky Footer
* Plugin URI: http://wpdevelopersclub.com/
* Description: Configurable Sticky footer with quick link panels added to enabled articles and pages.
* Version: 1.1.0
* Author: WP Developers Club and Tonya
* Author URI: https://wpdevelopersclub.com
* Text Domain: wpdevsclub
* Requires WP: 3.5
* Requires PHP: 5.4
*/
/*
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
use WPDevsClub_Core\Config\I_Config;
use WPDevsClub_Core\Config\Factory;
// Oh no you don't. Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit( 'Cheating’ uh?' );
}
if ( ! defined( 'WPDC_STICKY_FOOTER_DIR' ) ) {
define( 'WPDC_STICKY_FOOTER_DIR', plugin_dir_path( __FILE__ ) );
}
if ( ! defined( 'WPDC_STICKY_FOOTER_URL' ) ) {
$plugin_url = plugin_dir_url( __FILE__ );
if ( is_ssl() ) {
$plugin_url = str_replace( 'http://', 'https://', $plugin_url );
}
define( 'WPDC_STICKY_FOOTER_URL', $plugin_url );
}
require_once( __DIR__ . '/assets/vendor/autoload.php' );
add_action( 'wpdevclub_setup_sticky_footer', __NAMESPACE__ . '\\launch' );
/**
* Launch the plugin
*
* @since 1.1.0
*
* @param I_Config $config
* @return null
*/
function launch( I_Config $config ) {
if ( version_compare( $GLOBALS['wp_version'], Plugin::MIN_WP_VERSION, '>' ) ) {
if ( is_array( $config ) ) {
$config = Factory::create( $config );
}
new Plugin( $config );
}
}
/**
* Load up the plugin's variables within the Container
*
* @since 1.1.0
*
* @return null
*/
add_action( 'wpdevsclub_do_service_providers', function( $core ) {
$core['sticky_footer.dir'] = WPDC_STICKY_FOOTER_DIR;
$core['sticky_footer.url'] = WPDC_STICKY_FOOTER_URL;
$core['sticky_footer.default_config'] = WPDC_STICKY_FOOTER_DIR . 'config/structure-defaults.php';
$core['sticky_footer.config.plugin'] = WPDC_STICKY_FOOTER_DIR . 'config/plugin.php';
} );