-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathmicropub.php
More file actions
executable file
·68 lines (56 loc) · 2.03 KB
/
micropub.php
File metadata and controls
executable file
·68 lines (56 loc) · 2.03 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
<?php
/**
* Plugin Name: Micropub
* Plugin URI: https://github.com/indieweb/wordpress-micropub
* Description: <a href="https://indiewebcamp.com/micropub">Micropub</a> server.
* Protocol spec: <a href="https://micropub.spec.indieweb.org/">Micropub Living Standard</a>
* Author: IndieWeb WordPress Outreach Club
* Requires at least: 4.9.9
* Requires PHP: 7.2
* Requires Plugins: indieauth
* Author URI: https://indieweb.org/WordPress_Outreach_Club
* Text Domain: micropub
* License: CC0
* License URI: http://creativecommons.org/publicdomain/zero/1.0/
* Version: 2.5.0
*
* @package Micropub
*/
namespace Micropub;
\define( 'MICROPUB_PLUGIN_VERSION', '2.5.0' );
\defined( 'MICROPUB_NAMESPACE' ) || \define( 'MICROPUB_NAMESPACE', 'micropub/1.0' );
// For debugging purposes this will set all Micropub posts to Draft.
\defined( 'MICROPUB_DRAFT_MODE' ) || \define( 'MICROPUB_DRAFT_MODE', '0' );
\define( 'MICROPUB_PLUGIN_DIR', \plugin_dir_path( __FILE__ ) );
\define( 'MICROPUB_PLUGIN_FILE', __FILE__ );
// Load the autoloader.
require_once MICROPUB_PLUGIN_DIR . 'includes/class-autoloader.php';
// Register the autoloader.
Autoloader::register_path( __NAMESPACE__, MICROPUB_PLUGIN_DIR . 'includes' );
// Global Functions.
require_once MICROPUB_PLUGIN_DIR . 'includes/functions.php';
// Compatibility Functions with Newer WordPress Versions.
require_once MICROPUB_PLUGIN_DIR . 'includes/compat-functions.php';
if ( \class_exists( 'IndieAuth_Plugin' ) ) {
\add_action( 'plugins_loaded', array( Micropub::get_instance(), 'init' ) );
} else {
\add_action( 'admin_notices', __NAMESPACE__ . '\indieauth_not_installed_notice' );
}
/**
* Display IndieAuth not installed notice.
*/
function indieauth_not_installed_notice() {
?>
<div class="notice notice-error">
<p><?php \esc_html_e( 'To use Micropub, you must have IndieAuth support. Please install the IndieAuth plugin.', 'micropub' ); ?></p>
</div>
<?php
}
/**
* Get the plugin version.
*
* @return string
*/
function get_plugin_version() {
return Micropub::get_instance()->get_version();
}