-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenpub-rss.php
More file actions
80 lines (71 loc) · 1.7 KB
/
Copy pathopenpub-rss.php
File metadata and controls
80 lines (71 loc) · 1.7 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
<?php
/**
* Plugin Name: OpenPub RSS
* Plugin URI: https://www.openwebconcept.nl/
* Description: RSS feed functionality for OpenPub
* Version: 1.0.0
* Author: Acato
* Author URI: https://www.acato.nl/
* License: GPL-3.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
* Text Domain: openpub-rss
* Domain Path: /languages
*
* @package OWC\OpenPub\RSS
*/
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
/**
* Plugin version
*/
define( 'OPENPUB_RSS_VERSION', '1.0.0' );
/**
* Plugin directory path
*/
define( 'OPENPUB_RSS_DIR', plugin_dir_path( __FILE__ ) );
/**
* Plugin directory URL
*/
define( 'OPENPUB_RSS_URL', plugin_dir_url( __FILE__ ) );
/**
* Load the autoloader
*/
require_once plugin_dir_path( __FILE__ ) . 'src/includes' . DIRECTORY_SEPARATOR . 'class-autoloader.php';
spl_autoload_register( array( '\OWC\OpenPub\RSS\Includes\Autoloader', 'autoload' ) );
/**
* Activation hook - flush rewrite rules
*/
register_activation_hook(
__FILE__,
function () {
// Initialize the plugin to register rewrite rules.
if ( class_exists( 'OWC\\OpenPub\\RSS\\Includes\\Plugin' ) ) {
OWC\OpenPub\RSS\Includes\Plugin::instance();
}
// Flush rewrite rules so our custom URLs work immediately.
flush_rewrite_rules();
}
);
/**
* Deactivation hook - flush rewrite rules
*/
register_deactivation_hook(
__FILE__,
function () {
flush_rewrite_rules();
}
);
/**
* Begin execution of the plugin
*/
add_action(
'plugins_loaded',
function () {
if ( class_exists( 'OWC\\OpenPub\\RSS\\Includes\\Plugin' ) ) {
OWC\OpenPub\RSS\Includes\Plugin::instance();
}
},
10
);