-
Notifications
You must be signed in to change notification settings - Fork 1
/
lisa-templates.php
executable file
·67 lines (60 loc) · 2.13 KB
/
lisa-templates.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
<?php
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
/**
*
* @link https://miniup.gl
* @since 1.0.0
* @package Lisa_Templates
*
* @wordpress-plugin
* Plugin Name: Lisa Templates
* Plugin URI: https://templates.lisa.gl
* Description: Easily write templates filled with custom data that loads across your site.
* Version: 1.5.0
* Author: Pierre Minik Lynge
* Author URI: https://miniup.gl
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: lisa-templates
* Domain Path: /languages
* GitHub Plugin URI: pierreminik/lisa-templates
* GitHub Plugin URI: https://github.com/pierreminik/lisa-templates
*/
function Lisa_Templates_deactivate() {
deactivate_plugins( plugin_basename( __FILE__ ) );
}
function Lisa_Templates_dependency_admin_notice() {
echo '<div class="updated"><p><strong>Lisa Templates</strong> requires the plugin <a href="https://wordpress.org/plugins/timber-library/" target="_blank">Timber</a> to be activated; the plug-in has been <strong>deactivated</strong>.</p></div>';
if ( isset( $_GET['activate'] ) )
unset( $_GET['activate'] );
}
function Lisa_Templates_check_dependencies() {
if ( ! class_exists( '\Timber\Timber' ) ) {
add_action( 'admin_init', 'Lisa_Templates_deactivate' );
add_action( 'admin_notices', 'Lisa_Templates_dependency_admin_notice' );
} else {
/**
* The core plugin class that is used to define internationalization,
* admin-specific hooks, and public-facing site hooks.
*/
require plugin_dir_path( __FILE__ ) . 'includes/class-lisa.php';
/**
* Begins execution of the plugin.
*
* Since everything within the plugin is registered via hooks,
* then kicking off the plugin from this point in the file does
* not affect the page life cycle.
*
* @since 1.0.0
*/
function run_Lisa_Templates() {
$plugin = new Lisa_Templates();
$plugin->run();
}
run_Lisa_Templates();
}
}
add_action( 'plugins_loaded', 'Lisa_Templates_check_dependencies', 2 );