-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathwp-uf2.php
62 lines (52 loc) · 1.72 KB
/
wp-uf2.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
/**
* Plugin Name: Microformats 2
* Plugin URI: https://github.com/indieweb/wordpress-uf2
* Description: Adds Microformats 2 support to your WordPress installation or theme
* Author: IndieWeb WordPress Outreach Club
* Author URI: https://indieweb.org/WordPress_Outreach_Club
* Version: 1.2.0
* Text Domain: wp-uf2
*/
add_action( 'after_setup_theme', array( 'UF2_Plugin', 'init' ), 99 );
/**
* Adds Microformats 2 support to your WordPress theme
*
* @author Matthias Pfefferle
*/
class UF2_Plugin {
/**
* Initialize plugin
*/
public static function init() {
self::plugin_textdomain();
require_once dirname( __FILE__ ) . '/includes/class-uf2-settings.php';
new UF2_Settings();
// check if theme already supports Microformats 2
if ( current_theme_supports( 'microformats2' ) ) {
return;
}
if ( 1 === (int) get_option( 'uf2_author' ) ) {
require_once dirname( __FILE__ ) . '/includes/class-uf2-author.php';
$author = new UF2_Author();
}
require_once dirname( __FILE__ ) . '/includes/class-uf2-comment.php';
$comment = new UF2_Comment();
if ( 1 === (int) get_option( 'uf2_media' ) ) {
require_once dirname( __FILE__ ) . '/includes/class-uf2-media.php';
$media = new UF2_Media();
}
require_once dirname( __FILE__ ) . '/includes/class-uf2-post.php';
$post = new UF2_Post();
if ( function_exists( 'genesis_html5' ) && genesis_html5() ) {
require_once dirname( __FILE__ ) . '/includes/genesis.php';
}
}
/**
* Load language files
*/
public static function plugin_textdomain() {
// Note to self, the third argument must not be hardcoded, to account for relocated folders.
load_plugin_textdomain( 'wp-uf2', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
}
}