This repository has been archived on 2023-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
footnotes/src/footnotes.php

112 lines
3 KiB
PHP
Raw Normal View History

<?php
/**
* The plugin bootstrap file.
*
* This file is read by WordPress to generate the plugin information in the plugin
* admin area. This file also includes all of the dependencies used by the plugin,
* registers the activation and deactivation functions, and defines a function
* that starts the plugin.
2021-04-26 08:37:19 +00:00
*
2021-04-29 19:57:30 +00:00
* @package footnotes
* @license GPL-3.0-only
* @copyright 2021 Mark Cheret (email: mark@cheret.de)
* @since 1.0.0
2021-04-26 08:37:19 +00:00
*
* @wordpress-plugin
* Plugin Name: footnotes
* Plugin URI: https://wordpress.org/plugins/footnotes/
* Description: footnotes lets you easily add highly-customisable footnotes on your WordPress Pages and Posts.
* Version: 2.8.0d
2021-04-26 08:37:19 +00:00
* Requires at least: 3.9
* Requires PHP: 7.0
* Author: Mark Cheret
* Author URI: https://cheret.org/footnotes
* Text Domain: footnotes
* Domain Path: /languages
2021-04-26 08:37:19 +00:00
* License: GPL v3
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
*/
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
/**
2021-05-01 18:22:41 +00:00
* The plugin version.
2021-04-29 19:57:30 +00:00
*
* @link https://github.com/markcheret/footnotes/wiki/Versioning Versioning Guide
*
2021-05-01 18:22:41 +00:00
* @since 2.1.4
* @todo Draw from envfile rather than hard-coding.
* @var string PLUGIN_VERSION The version of this instance of the plugin.
*/
2021-04-27 07:47:50 +00:00
define( 'PLUGIN_VERSION', '2.8.0d' );
/**
2021-05-01 18:22:41 +00:00
* The environment that the plugin is configured for.
*
2021-05-01 18:22:41 +00:00
* This primarily affects whether minified or unminified CSS/JS files are
* requested.
2021-04-26 08:37:19 +00:00
*
2021-05-01 18:22:41 +00:00
* @since 2.5.5
* @todo Draw from envfile rather than hard-coding.
* @todo Replace with string for >2 environment options.
* @var bool PRODUCTION_ENV Whether the plugin is running in production mode or not. Default `false`.
2021-04-15 15:52:59 +00:00
*/
2021-04-26 10:54:58 +00:00
define( 'PRODUCTION_ENV', false );
2021-04-15 15:52:59 +00:00
/**
2021-05-01 18:22:41 +00:00
* Handles the activation of the plugin.
2021-04-29 19:57:30 +00:00
*
2021-05-01 18:22:41 +00:00
* @since 2.8.0
* @see Footnotes_Activator::activate()
*/
function activate_footnotes() {
2021-05-01 18:22:41 +00:00
/**
* Provides plugin activation functionality.
*/
require_once plugin_dir_path( __FILE__ ) . 'includes/class-footnotes-activator.php';
2021-05-01 18:22:41 +00:00
Footnotes_Activator::activate();
}
/**
2021-05-01 18:22:41 +00:00
* Handles the deactivation of the plugin.
2021-04-29 19:57:30 +00:00
*
2021-05-01 18:22:41 +00:00
* @since 2.8.0
* @see Footnotes_Deactivator::deactivate()
*/
2021-05-01 18:22:41 +00:00
function deactivate_footnotes() {
/**
* Provides plugin deactivation functionality.
*/
require_once plugin_dir_path( __FILE__ ) . 'includes/class-footnotes-deactivator.php';
2021-05-01 18:22:41 +00:00
Footnotes_Deactivator::deactivate();
}
register_activation_hook( __FILE__, 'activate_footnotes' );
register_deactivation_hook( __FILE__, 'deactivate_footnotes' );
/**
2021-05-01 18:22:41 +00:00
* The core plugin class that defines internationalization, admin-specific and
* public-facing site hooks and functionality.
*/
require plugin_dir_path( __FILE__ ) . 'includes/class-footnotes.php';
/**
* Begins execution of the plugin.
*
2021-05-01 18:22:41 +00:00
* Since everything within the plugin is registered via hooks, then kicking off
2021-04-29 19:57:30 +00:00
* the plugin from this point in the file does not affect the page life cycle.
*
2021-05-01 18:22:41 +00:00
* @since 2.8.0
*/
function run_footnotes() {
global $footnotes;
$footnotes = new Footnotes();
$footnotes->run();
}
run_footnotes();