Overview
  • Namespace
  • Class

Namespaces

  • None
  • WC_POS
    • Admin
      • Settings
        • Receipt
    • API
    • Gateways
    • Integrations
    • Products

Classes

  • WC_POS\Activator
  • WC_POS\Admin
  • WC_POS\Admin\Gateways
  • WC_POS\Admin\Menu
  • WC_POS\Admin\Notices
  • WC_POS\Admin\Orders
  • WC_POS\Admin\Page
  • WC_POS\Admin\Permalink
  • WC_POS\Admin\Plugins
  • WC_POS\Admin\Products
  • WC_POS\Admin\Settings
  • WC_POS\Admin\Settings\Access
  • WC_POS\Admin\Settings\Checkout
  • WC_POS\Admin\Settings\Customers
  • WC_POS\Admin\Settings\Gateways
  • WC_POS\Admin\Settings\General
  • WC_POS\Admin\Settings\HotKeys
  • WC_POS\Admin\Settings\Page
  • WC_POS\Admin\Settings\Receipt\Options
  • WC_POS\Admin\Settings\Receipt\Template
  • WC_POS\Admin\Settings\Receipts
  • WC_POS\Admin\Settings\Status
  • WC_POS\Admin\Settings\Tools
  • WC_POS\Admin\Status
  • WC_POS\Ajax
  • WC_POS\API
  • WC_POS\API\Coupons
  • WC_POS\API\Customers
  • WC_POS\API\Gateways
  • WC_POS\API\i18n
  • WC_POS\API\Orders
  • WC_POS\API\Params
  • WC_POS\API\Payload
  • WC_POS\API\Products
  • WC_POS\API\Settings
  • WC_POS\API\Support
  • WC_POS\API\Templates
  • WC_POS\Customers
  • WC_POS\Deactivator
  • WC_POS\Gateways
  • WC_POS\Gateways\Card
  • WC_POS\Gateways\Cash
  • WC_POS\i18n
  • WC_POS\Integrations\Bookings
  • WC_POS\Products
  • WC_POS\Products\Visibility
  • WC_POS\Setup
  • WC_POS\Status
  • WC_POS\Tax
  • WC_POS\Template

Functions

  • is_pos
  • is_pos_admin
  • wc_pos_get_option
  • wc_pos_json_encode
  • wc_pos_locate_template
  • wc_pos_trim_html_string
  • wc_pos_update_option
  • wc_pos_url
 1 <?php
 2 
 3 /**
 4  * WP Plugin Updates
 5  *
 6  * @class    WC_POS_Admin_Plugins
 7  * @package  WooCommerce POS
 8  * @author   Paul Kilmurray <paul@kilbot.com.au>
 9  * @link     http://www.woopos.com.au
10  */
11 
12 namespace WC_POS\Admin;
13 
14 class Plugins {
15 
16   public function __construct() {
17     add_filter( 'plugin_action_links_'. \WC_POS\PLUGIN_FILE, array ( $this, 'plugin_action_links' ) );
18     add_action( 'in_plugin_update_message-' . \WC_POS\PLUGIN_FILE, array ( $this, 'plugin_update_message' ), 10, 2 );
19   }
20 
21   /**
22    * Prepend Settings link to plugin actions
23    * @param $links
24    * @return array
25    */
26   public function plugin_action_links( $links ){
27     return array(
28       'settings' => '<a href="'. admin_url( 'admin.php?page=wc_pos_settings' ) .'">'. /* translators: wordpress */ __( 'Settings' ) .'</a>'
29     ) + $links;
30   }
31 
32   /**
33    * Thanks to: http://andidittrich.de/2015/05/howto-upgrade-notice-for-wordpress-plugins.html
34    * @param $currentPluginMetadata
35    * @param $newPluginMetadata
36    */
37   public function plugin_update_message( $currentPluginMetadata, $newPluginMetadata ){
38     if (isset($newPluginMetadata->upgrade_notice) && strlen(trim($newPluginMetadata->upgrade_notice)) > 0){
39       echo '<p style="background-color: #d54e21; padding: 10px; color: #f9f9f9; margin-top: 10px"><strong>'.  /* translators: wordpress */ __( 'Important:' ) . '</strong> ';
40       echo esc_html($newPluginMetadata->upgrade_notice), '</p>';
41     }
42   }
43 
44 }
API documentation generated by ApiGen