This repository has been archived by the owner on Feb 12, 2020. It is now read-only.
forked from daveykropf/es-list-user-searches
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathes-list-user-searches.php
57 lines (43 loc) · 1.87 KB
/
es-list-user-searches.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
/**
* Plugin Name: ElasticSearch List User Searches
* Description: List ElasticSearch User Searches in Wordpress back-end
* Plugin URI: https://github.com/daveykropf/es-list-user-searches
* Author: Davey Kropf
* Author URI: https://dkropf.nl
* Version: 1.0.3
* License: GPL2
*/
/*
Copyright (C) 2016 Davey Kropf [email protected]
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
if ( !defined( 'ABSPATH' ) ) exit;
add_action( 'plugins_loaded', array( 'ES_LIST_USER_SEARCHES', 'get_instance' ) );
require_once plugin_dir_path( __FILE__ ) . 'menu.php';
require_once plugin_dir_path( __FILE__ ) . 'inc/Database.php';
require_once plugin_dir_path( __FILE__ ) . 'inc/Overview.php';
require_once plugin_dir_path( __FILE__ ) . 'inc/Setup.php';
register_activation_hook( __FILE__, array( 'ES_List_User_Searches_Setup', 'on_activation' ) );
register_uninstall_hook( __FILE__, array( 'ES_List_User_Searches_Setup', 'on_uninstall' ) );
class ES_List_User_Searches {
private static $instance = null;
public static function get_instance() {
if ( !isset( self::$instance ) ) {
self::$instance = new self;
}
return self::$instance;
}
public static function save_search($search_query, $total_hits, $search_url = '') {
ES_List_User_Searches_Database::save_search($search_query, $total_hits, $search_url);
}
}