-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathwp-anyipsum.php
61 lines (49 loc) · 1.99 KB
/
wp-anyipsum.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
<?php
/*
Plugin Name: Any Ipsum
Description: Roll your own custom lorem ipsum generator
Plugin URI: https://wordpress.org/plugins/any-ipsum/
Version: 1.9.4
Author: Pete Nelson (@CodeGeekATX)
Text Domain: any-ipsum
Domain Path: /lang
*/
if ( ! defined( 'ABSPATH' ) ) die( 'restricted access' );
define( 'WP_ANY_IPSUM_ROOT', trailingslashit( dirname( __FILE__ ) ) );
// include required files
$includes = array( 'Generator', 'Settings', 'Core', 'Form', 'API', 'Oembed', 'WPCLI' );
foreach ( $includes as $include ) {
require_once plugin_dir_path( __FILE__ ) . 'lib/class-WPAnyIpsum' . $include . '.php';
}
require_once plugin_dir_path( __FILE__ ) . 'lib/sanitizers.php';
add_action( 'plugins_loaded', 'WPAnyIpsum_LoadTextDomain' );
if ( !function_exists( 'WPAnyIpsum_LoadTextDomain' ) ) {
function WPAnyIpsum_LoadTextDomain() {
load_plugin_textdomain( 'any-ipsum', false, basename( plugin_dir_path( __FILE__ ) ) . '/lang/' );
}
}
// load our classes, hook them to WordPress
if ( class_exists( 'WPAnyIpsumCore' ) ) {
$WPAnyIpsumCore = new WPAnyIpsumCore();
add_action( 'plugins_loaded', array( $WPAnyIpsumCore, 'plugins_loaded' ) );
}
if ( class_exists( 'WPAnyIpsumSettings' ) ) {
$WPAnyIpsumSettings = new WPAnyIpsumSettings();
add_action( 'plugins_loaded', array( $WPAnyIpsumSettings, 'plugins_loaded' ) );
register_activation_hook( __FILE__, array( $WPAnyIpsumSettings, 'activation_hook' ) );
}
if ( class_exists( 'WPAnyIpsumForm' ) ) {
$WPAnyIpsumForm = new WPAnyIpsumForm();
add_action( 'plugins_loaded', array( $WPAnyIpsumForm, 'plugins_loaded' ) );
}
if ( class_exists( 'WPAnyIpsumOEmbed' ) ) {
$WPAnyIpsumOEmbed = new WPAnyIpsumOEmbed();
add_action( 'plugins_loaded', array( $WPAnyIpsumOEmbed, 'plugins_loaded' ) );
}
if ( class_exists( 'WPAnyIpsumAPI' ) ) {
$WPAnyIpsumAPI = new WPAnyIpsumAPI();
add_action( 'plugins_loaded', array( $WPAnyIpsumAPI, 'plugins_loaded' ) );
}
if ( defined( 'WP_CLI' ) && WP_CLI && class_exists( 'WPAnyIpsumWPCLI' ) ) {
WP_CLI::add_command( 'any-ipsum', 'WPAnyIpsumWPCLI' );
}