-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhost-meta.php
executable file
·42 lines (36 loc) · 1.34 KB
/
host-meta.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
<?php
/**
* Plugin Name: host-meta
* Plugin URI: https://github.com/pfefferle/wordpress-host-meta
* Description: Host Metadata for WordPress
* Version: 1.3.2
* Author: Matthias Pfefferle
* Author URI: https://notiz.blog/
* License: GPL-2.0-or-later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: host-meta
* Domain Path: /languages
*/
register_activation_hook( __FILE__, 'host_meta_flush_rewrite_rules' );
register_deactivation_hook( __FILE__, 'flush_rewrite_rules' );
/**
* Initialize plugin
*/
function host_meta_init() {
require_once( dirname( __FILE__ ) . '/includes/class-host-meta.php' );
add_action( 'query_vars', array( 'Host_Meta', 'query_vars' ) );
add_action( 'parse_request', array( 'Host_Meta', 'parse_request' ), 2 );
add_action( 'init', array( 'Host_Meta', 'rewrite_rules' ), 1 );
add_action( 'host_meta_render_jrd', array( 'Host_Meta', 'render_jrd' ), 42, 1 );
add_action( 'host_meta_render_xrd', array( 'Host_Meta', 'render_xrd' ), 42, 1 );
add_filter( 'host_meta', array( 'Host_Meta', 'generate_default_content' ), 0, 1 );
}
add_action( 'plugins_loaded', 'host_meta_init' );
/**
* Generate rewrite rules and flush the old ruleset
*/
function host_meta_flush_rewrite_rules() {
require_once( dirname( __FILE__ ) . '/includes/class-host-meta.php' );
Host_Meta::rewrite_rules();
flush_rewrite_rules();
}