wp2static/wp-static-html-output.php

40 lines
1.3 KiB
PHP
Raw Normal View History

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
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__);
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
}