diff --git a/includes/class-partnerexpo-core.php b/includes/class-partnerexpo-core.php index 950018e..71425da 100644 --- a/includes/class-partnerexpo-core.php +++ b/includes/class-partnerexpo-core.php @@ -169,6 +169,7 @@ class Partnerexpo_Core { $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); + $this->loader->add_action( 'rest_api_init', $plugin_public, 'register_endpoint' ); $this->loader->add_action( 'init', $this, 'define_cpts' ); } diff --git a/partnerexpo-core.php b/partnerexpo-core.php index 0e3c33f..c4f085e 100644 --- a/partnerexpo-core.php +++ b/partnerexpo-core.php @@ -23,7 +23,7 @@ if ( ! defined( 'WPINC' ) ) { die; } -define( 'PARTNEREXPO_CORE_VERSION', '1.0.2' ); +define( 'PARTNEREXPO_CORE_VERSION', '1.0.3' ); function activate_partnerexpo_core() { require_once plugin_dir_path( __FILE__ ) . 'includes/class-partnerexpo-core-activator.php'; diff --git a/public/class-partnerexpo-core-public.php b/public/class-partnerexpo-core-public.php index aefa587..ac66912 100644 --- a/public/class-partnerexpo-core-public.php +++ b/public/class-partnerexpo-core-public.php @@ -53,36 +53,6 @@ class Partnerexpo_Core_Public { return ob_get_clean(); } - /** - * Register the stylesheets for the public-facing side of the site. - * - * @since 1.0.0 - */ - public function enqueue_styles() { - wp_register_style( - $this->plugin_name . '-searchbox-css', - plugin_dir_url( __FILE__ ) . 'css/searchbox.css', - [], - $this->version, - 'all' - ); - } - - /** - * Register the JavaScript for the public-facing side of the site. - * - * @since 1.0.0 - */ - public function enqueue_scripts() { - wp_register_script( - $this->plugin_name . '-searchbox-js', - plugin_dir_url( __FILE__ ) . 'js/searchbox.js', - [], - $this->version, - true - ); - } - public function register_endpoint() { register_rest_route('pexpo/v1', '/query', [ 'methods' => 'GET', @@ -116,4 +86,35 @@ class Partnerexpo_Core_Public { return rest_ensure_response($posts); } + /** + * Register the stylesheets for the public-facing side of the site. + * + * @since 1.0.0 + */ + public function enqueue_styles() { + wp_register_style( + $this->plugin_name . '-searchbox-css', + plugin_dir_url( __FILE__ ) . 'css/searchbox.css', + [], + $this->version, + 'all' + ); + } + + /** + * Register the JavaScript for the public-facing side of the site. + * + * @since 1.0.0 + */ + public function enqueue_scripts() { + wp_register_script( + $this->plugin_name . '-searchbox-js', + plugin_dir_url( __FILE__ ) . 'js/searchbox.js', + [], + $this->version, + true + ); + } + + }