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 Admin Class
 5  * conditionally loads classes for WP Admin
 6  *
 7  * @class    \WC_POS\Admin
 8  * @package  WooCommerce POS
 9  * @author   Paul Kilmurray <paul@kilbot.com.au>
10  * @link     http://www.woopos.com.au
11  */
12 
13 namespace WC_POS;
14 
15 class Admin {
16 
17   /**
18    * Constructor
19    */
20   public function __construct() {
21     $this->init();
22     add_action( 'current_screen', array( $this, 'conditional_init' ) );
23   }
24 
25   /**
26    * Load admin subclasses
27    */
28   private function init() {
29     new Admin\Notices();
30     new Admin\Menu();
31     new Admin\Settings();
32     new Admin\Status();
33     new Admin\Gateways();
34   }
35 
36   /**
37    * Conditionally load subclasses
38    * @param $current_screen
39    */
40   public function conditional_init( $current_screen ) {
41 
42     // Add setting to permalink page
43     if( $current_screen->id == 'options-permalink' )
44       new Admin\Permalink();
45 
46     // Add POS settings to orders pages
47     if( $current_screen->id == 'shop_order' || $current_screen->id == 'edit-shop_order'  )
48       new Admin\Orders();
49 
50     // Customise plugins page
51     if( $current_screen->id == 'plugins' )
52       new Admin\Plugins();
53 
54   }
55 
56 }
API documentation generated by ApiGen