3 if( class_exists( 'Yoast_License_Manager' ) && ! class_exists( "Yoast_Theme_License_Manager", false ) ) {
5 class Yoast_Theme_License_Manager extends Yoast_License_Manager {
8 * Setup auto updater for themes
10 public function setup_auto_updater() {
11 if ( $this->license_is_valid() ) {
13 require_once dirname( __FILE__ ) . '/class-update-manager.php';
14 require_once dirname( __FILE__ ) . '/class-theme-update-manager.php'; // @TODO: Autoload?
15 new Yoast_Theme_Update_Manager( $this->product, $this );
22 public function specific_hooks() {
23 // remotely deactivate license upon switching away from this theme
24 add_action( 'switch_theme', array( $this, 'deactivate_license' ) );
26 // Add the license menu
27 add_action( 'admin_menu', array( $this, 'add_license_menu' ) );
31 * Add license page and add it to Themes menu
33 public function add_license_menu() {
34 $theme_page = add_theme_page( sprintf( __( '%s License', $this->product->get_text_domain() ), $this->product->get_item_name() ), __( 'Theme License', $this->product->get_text_domain() ), 'manage_options', 'theme-license', array( $this, 'show_license_page' ) );
40 public function show_license_page() {
43 <?php settings_errors(); ?>
45 <?php $this->show_license_form( false ); ?>