-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontent-generator.php
More file actions
119 lines (90 loc) · 2.88 KB
/
content-generator.php
File metadata and controls
119 lines (90 loc) · 2.88 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<?php
/*
Plugin Name: Random Content Generator
Plugin URI: https://appthemes.com/
Description: Creates random content on your site.
Author: AppThemes
Version: 1.0
Author URI: https://appthemes.com/
*/
define( 'APP_RCG_TD', 'app-content-generator' );
/**
* Initialize Generator
*
* @return void
*/
function app_content_generator_init() {
global $app_content_generator;
if ( ! is_admin() ) {
return;
}
if ( ! class_exists( 'APP_Content_Generator_Data' ) ) {
require_once( 'classes/generator-data.php' );
}
if ( ! class_exists( 'APP_Content_Generator' ) ) {
require_once( 'classes/generator.php' );
}
// Quality Control
if ( defined( 'QC_VERSION' ) ) {
if ( ! class_exists( 'QC_Content_Generator' ) ) {
require_once( 'classes/qc-generator.php' );
}
$app_content_generator = new QC_Content_Generator();
// HireBee
} elseif ( defined( 'HRB_VERSION' ) ) {
if ( ! class_exists( 'HRB_Content_Generator' ) ) {
require_once( 'classes/hrb-generator.php' );
}
$app_content_generator = new HRB_Content_Generator();
// Rave
} elseif ( defined( 'RAVE_VERSION' ) ) {
if ( ! class_exists( 'RAVE_Content_Generator' ) ) {
require_once( 'classes/rave-generator.php' );
}
$app_content_generator = new RAVE_Content_Generator();
// Taskerr
} elseif ( defined( 'TR_VERSION' ) ) {
if ( ! class_exists( 'TR_Content_Generator' ) ) {
require_once( 'classes/tr-generator.php' );
}
$app_content_generator = new TR_Content_Generator();
// Vantage
} elseif ( defined( 'VA_VERSION' ) ) {
if ( ! class_exists( 'VA_Content_Generator' ) ) {
require_once( 'classes/va-generator.php' );
}
if ( version_compare( VA_VERSION, '4.0.0-dev-0', '<' ) ) {
$va_gen = 'VA_Content_Generator';
} elseif ( version_compare( VA_VERSION, '4.2.0', '<' ) ) {
$va_gen = 'VA_Content_Generator_4';
} else {
$va_gen = 'VA_Content_Generator_4_2';
}
$app_content_generator = new $va_gen();
// ClassiPress
} elseif ( defined( 'APP_POST_TYPE' ) && APP_POST_TYPE == 'ad_listing' ) {
if ( ! class_exists( 'CP_Content_Generator' ) ) {
require_once( 'classes/cp-generator.php' );
}
$app_content_generator = new CP_Content_Generator();
// Clipper
} elseif ( defined( 'APP_POST_TYPE' ) && APP_POST_TYPE == 'coupon' ) {
if ( ! class_exists( 'CLPR_Content_Generator' ) ) {
require_once( 'classes/clpr-generator.php' );
}
$app_content_generator = new CLPR_Content_Generator();
} else {
add_action( 'admin_notices', 'app_content_generator_display_warning' );
}
}
add_action( 'after_setup_theme', 'app_content_generator_init' );
/**
* Displays compatibility warning and disables plugin
*
* @return void
*/
function app_content_generator_display_warning() {
$message = __( 'AppThemes Random Content Generator does not support the current theme.', APP_RCG_TD );
echo '<div class="error fade"><p>' . $message . '</p></div>';
deactivate_plugins( plugin_basename( __FILE__ ) );
}