The Headers. Based upon a post from Julio Biason. * Version: 1.7.0 * Author: Andy Fragen * Author URI: http://thefragens.com * License: GNU General Public License v2 * License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html * Text Domain: add-custom-header-images * Domain Path: /languages * GitHub Plugin URI: https://github.com/afragen/add-custom-header-images * Requires WP: 3.4.0 * Requires PHP: 5.3 */ /** * Class Add_Custom_Header_Images */ class Add_Custom_Header_Images { /** * Variable to hold the data for `get_page_by_title()`. * * @var array|null|\WP_Post */ private $the_headers_page; /** * Constructor. */ public function __construct() { $the_headers_title = __('The Headers', 'add-custom-header-images'); $this->the_headers_page = get_page_by_title(esc_attr($the_headers_title)); $this->run(); } /** * Let's get started. * * @return bool */ public function run() { global $wp_version; load_plugin_textdomain('add-custom-header-images', false, basename(dirname(__FILE__))); if ($wp_version < 3.4 || (is_admin() && null === $this->the_headers_page) ) { add_action('admin_notices', array( $this, 'headers_page_present' )); return false; } if (! is_admin()) { add_action('after_setup_theme', array( $this, 'new_default_header_images' ), 99); } } /** * Disable plugin if 'The Headers' page does not exist. */ public function headers_page_present() { ?>
', '' ); ?>