WC_POS_Admin_Plugins

WP Plugin Updates.

Defined (1)

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

/includes/admin/class-wc-pos-plugins.php  
  1. class WC_POS_Admin_Plugins { 
  2.  
  3. public function __construct() { 
  4. add_filter( 'plugin_action_links_'. WC_POS_PLUGIN_FILE, array ( $this, 'plugin_action_links' ) ); 
  5. add_action( 'in_plugin_update_message-' . WC_POS_PLUGIN_FILE, array ( $this, 'plugin_update_message' ), 10, 2 ); 
  6.  
  7. /** 
  8. * Prepend Settings link to plugin actions 
  9. * @param $links 
  10. * @return array 
  11. */ 
  12. public function plugin_action_links( $links ) { 
  13. return array( 
  14. 'settings' => '<a href="'. admin_url( 'admin.php?page=wc_pos_settings' ) .'">'. /** translators: wordpress */ __( 'Settings' ) .'</a>' 
  15. ) + $links; 
  16.  
  17. /** 
  18. * Thanks to: http://andidittrich.de/2015/05/howto-upgrade-notice-for-wordpress-plugins.html 
  19. * @param $currentPluginMetadata 
  20. * @param $newPluginMetadata 
  21. */ 
  22. public function plugin_update_message( $currentPluginMetadata, $newPluginMetadata ) { 
  23. if (isset($newPluginMetadata->upgrade_notice) && strlen(trim($newPluginMetadata->upgrade_notice)) > 0) { 
  24. echo '<p style="background-color: #d54e21; padding: 10px; color: #f9f9f9; margin-top: 10px"><strong>'. /** translators: wordpress */ __( 'Important:' ) . '</strong> '; 
  25. echo esc_html($newPluginMetadata->upgrade_notice), '</p>'; 
  26.