website-openclosed-toggle
Last commit date
woct
10 years ago
LICENSE.txt
10 years ago
README.txt
5 years ago
index.php
10 years ago
website-openclosed-toggle.php
5 years ago
website-openclosed-toggle.php
55 lines
| 1 | <?php |
| 2 | /* |
| 3 | Plugin Name: Website Open/Closed Toggle |
| 4 | Description: This plugin allows you to easily open and close your website and display a custom message or HTML page when closed. |
| 5 | Version: 0.1 |
| 6 | Author: RS |
| 7 | Author URI: https://rs.scot |
| 8 | Author Email: wordpress.plugins@rs.scot |
| 9 | License: GPLv3 or later |
| 10 | License URI: http://www.gnu.org/licenses/gpl-3.0.html |
| 11 | |
| 12 | Copyright 2015 RS (wordpress.plugins@rs.scot) |
| 13 | |
| 14 | This program is free software; you can redistribute it and/or modify |
| 15 | it under the terms of the GNU General Public License, version 3, as |
| 16 | published by the Free Software Foundation. |
| 17 | |
| 18 | This program is distributed in the hope that it will be useful, |
| 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 21 | GNU General Public License for more details. |
| 22 | |
| 23 | You should have received a copy of the GNU General Public License |
| 24 | along with this program; if not, write to the Free Software |
| 25 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 26 | |
| 27 | */ |
| 28 | |
| 29 | if( !defined( 'ABSPATH' ) ) { exit; } |
| 30 | |
| 31 | define( 'RS_WOCT__ADMIN_PAGE', 'rs-woct' ); |
| 32 | define( 'RS_WOCT__BASE', 'woct/' ); |
| 33 | define( 'RS_WOCT__OPTION', 'rs_woct_settings' ); |
| 34 | define( 'RS_WOCT__PLUGIN_ADMIN_URL', admin_url( 'admin.php?page='.RS_WOCT__ADMIN_PAGE ) ); |
| 35 | define( 'RS_WOCT__PLUGIN_DIR', plugin_dir_path( __FILE__ ).RS_WOCT__BASE ); |
| 36 | define( 'RS_WOCT__PLUGIN_FILE', __FILE__ ); |
| 37 | define( 'RS_WOCT__PLUGIN_NAME', 'Website Open/Closed Toggle' ); |
| 38 | define( 'RS_WOCT__PLUGIN_URL', plugin_dir_url( __FILE__ ) ); |
| 39 | define( 'RS_WOCT__PLUGIN_VERSION', '0.1' ); |
| 40 | |
| 41 | foreach( glob( RS_WOCT__PLUGIN_DIR.'*.php' ) as $file ) { require_once( $file ); } |
| 42 | |
| 43 | add_action( 'admin_enqueue_scripts', 'rs_woct_css' ); |
| 44 | add_action( 'admin_menu', 'rs_woct_setup_menu' ); |
| 45 | add_action( 'init', 'rs_woct_output' ); |
| 46 | |
| 47 | add_filter( 'plugin_action_links', 'rs_woct_plugin_links', 10, 2 ); |
| 48 | |
| 49 | register_activation_hook( RS_WOCT__PLUGIN_FILE, 'rs_woct_on_activation' ); |
| 50 | register_deactivation_hook( RS_WOCT__PLUGIN_FILE, 'rs_woct_on_deactivation' ); |
| 51 | |
| 52 | wp_register_style( 'rs_woct_css', RS_WOCT__PLUGIN_URL.RS_WOCT__BASE.'css/style.css', array(), RS_WOCT__PLUGIN_VERSION, 'screen' ); |
| 53 | |
| 54 | function rs_woct_on_activation() { rs_woct_activate(); } |
| 55 | function rs_woct_on_deactivation() { rs_woct_deactivate(); } |