forked from meilisearch/meilisearch-wordpress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
meilisearch-wordpress.php
31 lines (26 loc) · 1.1 KB
/
meilisearch-wordpress.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
/*
Plugin Name: Meilisearch Wordpress
Plugin URI: https://wordpress.meilisearch.dev
description: The best search experience in wordpress with Meilisearch
Version: 0.1.0
Author: Meilisearch
Author URI: https://meilisearch.com
License: MIT
*/
require_once __DIR__ . '/vendor/autoload.php';
require_once __DIR__ . '/src/search_widget.php';
require_once __DIR__ . '/src/admin/meilisearch_admin.php';
require_once __DIR__ . '/src/admin/utils.php';
function meilisearch_scripts() {
wp_register_style( 'meilisearch_widget', plugin_dir_url( __FILE__ ).'src/css/meilisearch_widget.css' );
wp_enqueue_style('meilisearch_widget');
}
add_action('wp_insert_post', 'index_post_after_update', 1000, 3);
add_action('rest_after_insert_post', 'index_post_after_meta_update', 1000, 2);
add_action('wp_trash_post', 'delete_post_from_index');
add_action( 'wp_enqueue_scripts', 'meilisearch_scripts' );
register_activation_hook( __FILE__, 'meilisearch_wordpress_activate' );
if ( is_admin() )
$meilisearch = new MeiliSearch();
?>