includes(); $this->publicIncludes(); } /** * Return an instance of this class. * * @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; } /** * Get templates path. * * @return string */ public static function get_templates_path() { return plugin_dir_path( __FILE__ ) . 'templates/'; } /** * Load the plugin text domain for translation. */ public function load_plugin_textdomain() { load_plugin_textdomain( 'age-restriction-18-for-checkout-fields', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); } /** * Instalation Plugin */ public function age_restriction_18_for_checkout_fields_install() { // Trigger our function that registers the custom post type pluginprefix_setup_post_types(); // Clear the permalinks after the post type has been registered flush_rewrite_rules(); } /** * Includes */ private function includes() { include_once 'admin/controllers/controller-register-admin-pages.php'; } /** * Includes */ private function publicIncludes() { include_once 'public/controllers/controller-validate-fields-checkout.php'; } /** * Debug */ public function log_me($message) { if (WP_DEBUG === true) { if (is_array($message) || is_object($message)) { error_log(print_r($message, true)); } else { error_log($message); } } } } add_action( 'plugins_loaded', array( 'Age_Restriction_18_for_checkout_fields', 'get_instance' ) ); endif; //register_deactivation_hook ( __FILE__ , 'pluginprefix_function_to_run' );