2016-12-27 14:30:54 +13:00
|
|
|
<?php
|
|
|
|
/*
|
|
|
|
Plugin Name: WP Static HTML Output
|
|
|
|
Plugin URI: https://leonstafford.github.io
|
2016-12-27 20:06:50 +13:00
|
|
|
Description: Benefit from WordPress as a CMS but with the speed, performance and portability of a static site
|
2017-04-02 08:50:20 +12:00
|
|
|
Version: 1.9
|
2016-12-27 14:30:54 +13:00
|
|
|
Author: Leon Stafford
|
|
|
|
Author URI: https://leonstafford.github.io
|
|
|
|
Text Domain: static-html-output-plugin
|
|
|
|
|
2017-03-11 14:54:51 +13:00
|
|
|
Copyright (c) 2017 Leon Stafford
|
2016-12-27 14:30:54 +13:00
|
|
|
*/
|
|
|
|
|
|
|
|
require_once 'library/StaticHtmlOutput/Options.php';
|
|
|
|
require_once 'library/StaticHtmlOutput/View.php';
|
|
|
|
require_once 'library/StaticHtmlOutput/UrlRequest.php';
|
|
|
|
require_once 'library/StaticHtmlOutput.php';
|
|
|
|
|
|
|
|
StaticHtmlOutput::init(__FILE__);
|
|
|
|
|
2017-04-02 22:14:15 +12:00
|
|
|
function pluginActionLinks($links) {
|
2016-12-27 14:30:54 +13:00
|
|
|
$settings_link = '<a href="tools.php?page=wp-static-html-output-options">' . __('Settings', 'static-html-output-plugin') . '</a>';
|
|
|
|
array_unshift( $links, $settings_link );
|
|
|
|
return $links;
|
|
|
|
}
|
|
|
|
|
2017-03-11 14:54:51 +13:00
|
|
|
function initialise_localisation() {
|
|
|
|
load_plugin_textdomain( 'static-html-output-plugin', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
|
2016-12-27 14:30:54 +13:00
|
|
|
}
|
2016-12-29 16:20:49 +13:00
|
|
|
|
2017-03-11 14:54:51 +13:00
|
|
|
add_filter('plugin_action_links_' . plugin_basename(__FILE__), 'pluginActionLinks');
|
|
|
|
add_action('plugins_loaded', 'initialise_localisation');
|
2016-12-29 17:22:51 +13:00
|
|
|
add_action( 'wp_ajax_generate_archive', 'generate_archive' );
|
2016-12-29 16:20:49 +13:00
|
|
|
|
2016-12-29 17:22:51 +13:00
|
|
|
function generate_archive() {
|
|
|
|
$plugin = StaticHtmlOutput::getInstance();
|
|
|
|
$plugin->genArch();
|
|
|
|
wp_die();
|
2016-12-29 16:20:49 +13:00
|
|
|
}
|