-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path100prints.php
More file actions
65 lines (57 loc) · 1.82 KB
/
Copy path100prints.php
File metadata and controls
65 lines (57 loc) · 1.82 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
<?php
/**
* Plugin Name: 100Prints Document
* Plugin URI: https://100printswith.me
* Description: Generate personalized certificates, ID cards, tickets and PDFs directly from your WordPress site.
* Version: 1.0.1
* Author: 100PrintsWithMe
* Text Domain: 100prints
* Domain Path: /languages
* Requires at least: 6.3
* Requires PHP: 8.1
*/
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
define( 'HUNDRED_PRINTS_VERSION', '1.0.1' );
define( 'HUNDRED_PRINTS_PLUGIN_FILE', __FILE__ );
define( 'HUNDRED_PRINTS_PATH', plugin_dir_path( __FILE__ ) );
define( 'HUNDRED_PRINTS_URL', plugin_dir_url( __FILE__ ) );
/**
* The code that runs during plugin activation.
*/
function activate_hundred_prints() {
require_once HUNDRED_PRINTS_PATH . 'includes/class-activator.php';
Hundred_Prints_Activator::activate();
}
/**
* The code that runs during plugin deactivation.
*/
function deactivate_hundred_prints() {
require_once HUNDRED_PRINTS_PATH . 'includes/class-deactivator.php';
Hundred_Prints_Deactivator::deactivate();
}
register_activation_hook( __FILE__, 'activate_hundred_prints' );
register_deactivation_hook( __FILE__, 'deactivate_hundred_prints' );
/**
* The core plugin class that is used to define internationalization,
* admin-specific hooks, and public-facing site hooks.
*/
require HUNDRED_PRINTS_PATH . 'includes/class-plugin.php';
/**
* Begins execution of the plugin.
*/
function run_hundred_prints() {
$plugin = new Hundred_Prints();
$plugin->run();
}
run_hundred_prints();
add_action( 'admin_init', function() {
global $wpdb;
$table = $wpdb->prefix . '100p_generation_history';
if ( $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $table ) ) !== $table ) {
require_once HUNDRED_PRINTS_PATH . 'includes/class-activator.php';
Hundred_Prints_Activator::activate();
}
} );