message = $this->get_message(); add_action( 'after_switch_theme', array( $this, 'switch_theme' ) ); add_action( 'load-customize.php', array( $this, 'customize' ) ); add_action( 'template_redirect', array( $this, 'preview' ) ); } /** * Get message. * * @since 1.0.0 * @access private * * @return string */ private function get_message() { return sprintf( __( 'Aesblo requires at least WordPress version 4.1. You are running version %s. Please upgrade and try again.', 'aesblo' ), $GLOBALS['wp_version'] ); } /** * Prevent switching to old versions of WordPress. * * Switches to the default theme. * * @since 1.0.0 * @access public */ public function switch_theme() { switch_theme( WP_DEFAULT_THEME, WP_DEFAULT_THEME ); unset( $_GET['activated'] ); add_action( 'admin_notices', array( $this, 'upgrade_notice' ) ); } /** * Add message for unsuccessful theme switch. * * @since 1.0.0 * @access public */ public function upgrade_notice() { printf( '
%s