The Headers. Based upon a post from Julio Biason. Version: 1.0.2 Author: Andy Fragen Author URI: http://thefragens.com Text Domain: add-custom-header-images Domain Path: /languages GitHub Plugin URI: https://github.com/afragen/add-custom-header-images GitHub Branch: master */ /* Copyright 2014 Andy Fragen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * Class Add_Custom_Header_Images */ class Add_Custom_Header_Images { /** * Constructor */ public function __construct() { add_action( 'plugins_loaded', array( $this, 'headers_page_present' ) ); add_action( 'after_setup_theme', array( $this, 'remove_header_images' ), 11, 2 ); add_action( 'after_setup_theme', array( $this, 'new_default_header_images' ) ); load_plugin_textdomain( 'add-custom-header-images', false, basename( dirname( __FILE__ ) ) ); } /** * Disable plugin if 'The Headers' page does not exist */ public function headers_page_present () { global $wp_version; if ( is_admin() ) { if ( ( is_null( get_page_by_title( 'The Headers' ) ) ) || ( ! ( $wp_version >= 3.4 ) ) ) { $warning = '
' . __( 'Add Custom Header Images requires a page titled The Headers with images and WordPress v3.4 or greater.', 'add-custom-header-images' ) . '