Yoast_Theme_License_Manager

The Google Analytics by MonsterInsights Yoast Theme License Manager class.

Defined (1)

The class is defined in the following location(s).

/vendor/yoast/license-manager-2/class-theme-license-manager.php  
  1. class Yoast_Theme_License_Manager extends Yoast_License_Manager { 
  2.  
  3. /** 
  4. * Setup auto updater for themes 
  5. */ 
  6. public function setup_auto_updater() { 
  7. if ( $this->license_is_valid() ) { 
  8. // setup auto updater 
  9. require_once dirname( __FILE__ ) . '/class-update-manager.php'; 
  10. require_once dirname( __FILE__ ) . '/class-theme-update-manager.php'; // @TODO: Autoload? 
  11. new Yoast_Theme_Update_Manager( $this->product, $this ); 
  12.  
  13. /** 
  14. * Setup hooks 
  15. */ 
  16. public function specific_hooks() { 
  17. // remotely deactivate license upon switching away from this theme 
  18. add_action( 'switch_theme', array( $this, 'deactivate_license' ) ); 
  19.  
  20. // Add the license menu 
  21. add_action( 'admin_menu', array( $this, 'add_license_menu' ) ); 
  22.  
  23. /** 
  24. * Add license page and add it to Themes menu 
  25. */ 
  26. public function add_license_menu() { 
  27. 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' ) ); 
  28.  
  29. /** 
  30. * Shows license page 
  31. */ 
  32. public function show_license_page() { 
  33. ?> 
  34. <div class="wrap"> 
  35. <?php settings_errors(); ?> 
  36.  
  37. <?php $this->show_license_form( false ); ?> 
  38. </div> 
  39. <?php