Initial import of 404 Enhacer
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/**
|
||||
* Plugin Name: 404 Enhancer
|
||||
* Plugin URI: https://example.com/404-enhancer
|
||||
* Description: Enhances the 404 page with a custom message, featured image, hand-picked content, a search form, URL-based suggestions, cross-links and a "did you mean" hint.
|
||||
* Version: 0.3
|
||||
* Requires at least: 6.0
|
||||
* Requires PHP: 7.4
|
||||
* Author: Your Name
|
||||
* Text Domain: 404-enhancer
|
||||
* Domain Path: /languages
|
||||
*
|
||||
* @package 404_Enhancer
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
define( 'FE_VERSION', '0.3' );
|
||||
define( 'FE_PLUGIN_FILE', __FILE__ );
|
||||
define( 'FE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
||||
define( 'FE_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
||||
define( 'FE_SLUG', dirname( plugin_basename( __FILE__ ) ) );
|
||||
|
||||
require_once FE_PLUGIN_DIR . 'includes/class-fe-settings.php';
|
||||
require_once FE_PLUGIN_DIR . 'includes/class-fe-suggestions.php';
|
||||
require_once FE_PLUGIN_DIR . 'includes/class-fe-template.php';
|
||||
require_once FE_PLUGIN_DIR . 'includes/class-fe-updater.php';
|
||||
|
||||
/**
|
||||
* Loads the plugin text domain for translations.
|
||||
*/
|
||||
function fe_load_textdomain() {
|
||||
load_plugin_textdomain( '404-enhancer', false, FE_SLUG . '/languages' );
|
||||
}
|
||||
add_action( 'plugins_loaded', 'fe_load_textdomain' );
|
||||
|
||||
/**
|
||||
* Seeds default options on activation.
|
||||
*/
|
||||
function fe_activate() {
|
||||
if ( false === get_option( 'fe_enabled_post_types' ) ) {
|
||||
add_option( 'fe_enabled_post_types', array( 'post' ) );
|
||||
}
|
||||
if ( false === get_option( 'fe_suggestions_per_page' ) ) {
|
||||
add_option( 'fe_suggestions_per_page', 6 );
|
||||
}
|
||||
}
|
||||
register_activation_hook( __FILE__, 'fe_activate' );
|
||||
|
||||
FE_Settings::init();
|
||||
FE_Template::init();
|
||||
FE_Updater::init();
|
||||
Reference in New Issue
Block a user