WCML_Languages_Upgrade_Notice

The WooCommerce Multilingual WCML Languages Upgrade Notice class.

Defined (1)

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

/inc/template-classes/class-wcml-languages-upgrade-notice.php  
  1. class WCML_Languages_Upgrade_Notice extends WPML_Templates_Factory { 
  2.  
  3. private $notices; 
  4.  
  5. function __construct( $notices ) { 
  6. parent::__construct(); 
  7.  
  8. $this->notices = $notices; 
  9.  
  10. public function get_model() { 
  11.  
  12. $model = array( 
  13. 'notices' => implode(', ', $this->notices ),  
  14. 'is_multisite' => is_multisite(),  
  15. 'strings' => array( 
  16. 'update_trnsl' => __('Update Translation', 'woocommerce-multilingual'),  
  17. 'hide' => __('Hide This Message', 'woocommerce-multilingual'),  
  18. 'trnsl_available' => sprintf( __( '<strong>WooCommerce Translation Available</strong> – Install or update your <code>%s</code> translations to version <code>%s</code>.', 'woocommerce-multilingual' ), implode(', ', $this->notices ), WC_VERSION ) 
  19. ),  
  20. 'nonces' => array( 
  21. 'debug_action' => wp_nonce_url( admin_url( 'admin.php?page=wc-status&tab=tools&action=translation_upgrade' ), 'debug_action' ),  
  22. 'upgrade_translations' => wp_nonce_url( add_query_arg( array( 'action' => 'do-translation-upgrade' ), admin_url( 'update-core.php' ) ), 'upgrade-translations' ),  
  23. 'hide_notice' => wp_create_nonce('hide_wcml_translations_message') 
  24. ); 
  25.  
  26. return $model; 
  27.  
  28.  
  29. protected function init_template_base_dir() { 
  30. $this->template_paths = array( 
  31. WCML_PLUGIN_PATH . '/templates/',  
  32. ); 
  33.  
  34. public function get_template() { 
  35. return 'languages-notice.twig'; 
  36.