app = new App(); $this->add_actions(); // $this->add_filters(); $this->init_options(); } /** * Add actions. */ public function add_actions() { # enqueue scripts and styles on frontend add_action('wp_enqueue_scripts', [$this, 'enqueue_scripts']); } /** * Init February Kit */ public function init_options() { # Dummy options $sections = $this->app->sections(); /** * Initialize the options before anything else. */ February::create($sections); } /** * Enqueue scripts and styles on frontend. */ public function enqueue_scripts() { # enqueue scripts and styles on frontend wp_enqueue_script('ajaxpress', _AjaxPress_Public . 'js/ajaxpress.js', ['jquery'], '1.0.0', true); wp_enqueue_style('ajaxpress', _AjaxPress_Public . 'css/ajaxpress.min.css', [], '1.0.0'); // localize script wp_localize_script('ajaxpress', '_ajaxpress', [ 'ajaxurl' => admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce('ajaxpress'), 'settings' => $this->app->get_options(), ]); } } # Instantiating the Hooks class $hooks = new Hooks();