-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathclass-launch-with-words.php
99 lines (83 loc) · 2.38 KB
/
class-launch-with-words.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
93
94
95
96
97
98
99
<?php
/**
* Launch with Words Importer
*
* @package Launch with Words
*/
namespace LWW;
/**
* Plugin Name: Launch With Words
* Plugin URI: https://bridgetwillard.com/launch-with-words/
* Description: Launch With Words installs a year's worth of blog post prompts to encourage and guide your client in blogging best practices -- not lorem ipsum or bacon ipsum or other placeholder text.
* Version: 1.1.2
* Requires at least: 5.1
* Requires PHP: 5.6
* Author: MediaRon LLC
* Author URI: https://mediaron.com
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: launch-with-words
* Domain Path: /languages
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Setup the plugin auto loader.
require_once 'autoloader.php';
define( 'LWW_FILE', __FILE__ );
define( 'LWW_VERSION', '1.1.2' );
/**
* The plugin base class.
*/
class Launch_With_Words {
/**
* Launch With Words instance.
*
* @var Launch_With_Words $instance
*/
private static $instance = null;
/**
* Return a class instance.
*/
public static function get_instance() {
if ( null === self::$instance ) {
self::$instance = new self();
}
return self::$instance;
}
/**
* Class Constructor
*/
private function __construct() {
add_action( 'plugins_loaded', array( $this, 'plugins_loaded' ), 20 );
add_action( 'init', array( $this, 'init' ) );
}
/**
* Fired when the init action for WordPress is triggered.
*/
public function init() {
load_plugin_textdomain(
'launch-with-words',
false,
dirname( plugin_basename( LWW_FILE ) ) . '/languages/'
);
}
/**
* Fired when the plugins for WordPress have finished loading.
*/
public function plugins_loaded() {
// Register import menu.
$this->import_menu = new \LWW\Includes\Register_Menu();
$this->import_menu->run();
// Register plugin settings.
$this->plugin_settings = new \LWW\Includes\Plugin_Settings_Links();
$this->plugin_settings->run();
// Tabs initializer.
$this->tabs = new \LWW\Includes\Templates\Init();
$this->tabs->run();
}
}
Launch_With_Words::get_instance();
register_activation_hook( __FILE__, array( '\LWW\Includes\Plugin_Settings_Links', 'plugin_activate' ) );
add_action( 'admin_init', array( '\LWW\Includes\Plugin_Settings_Links', 'redirect_to_import_screen' ) );