mirror of
https://ghproxy.net/https://github.com/elementor/wp2static.git
synced 2025-08-31 04:44:04 +08:00
tidy up main plugin file
This commit is contained in:
parent
fa962dc600
commit
70c3f56c1e
1 changed files with 6 additions and 20 deletions
|
@ -3,12 +3,12 @@
|
|||
Plugin Name: WP Static HTML Output
|
||||
Plugin URI: https://leonstafford.github.io
|
||||
Description: Benefit from WordPress as a CMS but with the speed, performance and portability of a static site
|
||||
Version: 1.2.0
|
||||
Version: 1.2.1
|
||||
Author: Leon Stafford
|
||||
Author URI: https://leonstafford.github.io
|
||||
Text Domain: static-html-output-plugin
|
||||
|
||||
Copyright (c) 2011 Leon Stafford
|
||||
Copyright (c) 2017 Leon Stafford
|
||||
*/
|
||||
|
||||
require_once 'library/StaticHtmlOutput/Exception.php';
|
||||
|
@ -19,12 +19,6 @@ require_once 'library/StaticHtmlOutput.php';
|
|||
|
||||
StaticHtmlOutput::init(__FILE__);
|
||||
|
||||
add_filter('plugin_action_links_' . plugin_basename(__FILE__), 'pluginActionLinks');
|
||||
|
||||
/**
|
||||
* Adds link to options page from Plugins list
|
||||
* @return array
|
||||
*/
|
||||
function pluginActionLinks($links)
|
||||
{
|
||||
$settings_link = '<a href="tools.php?page=wp-static-html-output-options">' . __('Settings', 'static-html-output-plugin') . '</a>';
|
||||
|
@ -32,24 +26,16 @@ function pluginActionLinks($links)
|
|||
return $links;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes localization
|
||||
* @return void
|
||||
*/
|
||||
|
||||
function myplugin_init() {
|
||||
|
||||
load_plugin_textdomain( 'static-html-output-plugin', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
|
||||
function initialise_localisation() {
|
||||
load_plugin_textdomain( 'static-html-output-plugin', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
|
||||
}
|
||||
add_action('plugins_loaded', 'myplugin_init');
|
||||
|
||||
add_filter('plugin_action_links_' . plugin_basename(__FILE__), 'pluginActionLinks');
|
||||
add_action('plugins_loaded', 'initialise_localisation');
|
||||
add_action( 'wp_ajax_generate_archive', 'generate_archive' );
|
||||
|
||||
function generate_archive() {
|
||||
|
||||
$plugin = StaticHtmlOutput::getInstance();
|
||||
|
||||
$plugin->genArch();
|
||||
|
||||
wp_die();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue