/** * Initialize the plugin by loading admin scripts & styles and adding a * settings page and menu. * * @since 1.0.0 */ private function __construct() { /* * Call $plugin_slug from public plugin class. */ $plugin = Local_Pickup_Time::get_instance(); $this->plugin_slug = $plugin->get_plugin_slug(); /* * Show Pickup Time Settings in the WooCommerce -> General Admin Screen */ add_filter('woocommerce_general_settings', array($this, 'add_hours_and_closings_options')); /* * Show Pickup Time in the Order Details in the Admin Screen */ $admin_hooked_location = apply_filters('local_pickup_time_admin_location', 'woocommerce_admin_order_data_after_billing_address'); add_action($admin_hooked_location, array($this, 'show_metabox'), 10, 1); }
/** * Return an instance of this class. * * @since 1.0.0 * * @return object A single instance of this class. */ public static function get_instance() { // If the single instance hasn't been set, set it now. if (null == self::$instance) { self::$instance = new self(); } return self::$instance; }