-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsample-data-generator.php
More file actions
50 lines (41 loc) · 1.5 KB
/
sample-data-generator.php
File metadata and controls
50 lines (41 loc) · 1.5 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
<?php
/**
* Plugin Name: Sample Data Generator
* Description: Generate sample WordPress posts and WooCommerce products (optional) for testing and development
* Version: 1.0.0
* Author: Yogesh Sambare
* Author URI: https://example.com
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: sample-data-generator
* Domain Path: /languages
* Requires PHP: 7.4
*
* @package Sample_Data_Generator
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
define( 'SMDG_VERSION', '1.0.0' );
define( 'SMDG_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'SMDG_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
define( 'SMDG_PLUGIN_FILE', __FILE__ );
require_once SMDG_PLUGIN_DIR . 'includes/class-sample-data-generator.php';
require_once SMDG_PLUGIN_DIR . 'includes/class-smdg-admin.php';
require_once SMDG_PLUGIN_DIR . 'includes/class-smdg-product-generator.php';
require_once SMDG_PLUGIN_DIR . 'includes/class-smdg-post-generator.php';
function sample_data_generator_init() {
if ( ! class_exists( 'Sample_Data_Generator' ) ) {
return;
}
Sample_Data_Generator::init();
}
add_action( 'plugins_loaded', 'sample_data_generator_init' );
function sample_data_generator_activate() {
flush_rewrite_rules();
}
register_activation_hook( SMDG_PLUGIN_FILE, 'sample_data_generator_activate' );
function sample_data_generator_deactivate() {
flush_rewrite_rules();
}
register_deactivation_hook( SMDG_PLUGIN_FILE, 'sample_data_generator_deactivate' );