forked from 10up/ElasticPress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathelasticpress.php
84 lines (64 loc) · 2.27 KB
/
elasticpress.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
/**
* Plugin Name: ElasticPress
* Description: Integrate WordPress search with Elasticsearch
* Version: 1.9.1
* Author: Aaron Holbrook, Taylor Lovett, Matt Gross, 10up
* Author URI: http://10up.com
* License: GPLv2 or later
* Text Domain: elasticpress
* Domain Path: /lang/
* This program derives work from Alley Interactive's SearchPress
* and Automattic's VIP search plugin:
*
* Copyright (C) 2012-2013 Automattic
* Copyright (C) 2013 SearchPress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
define( 'EP_URL', plugin_dir_url( __FILE__ ) );
define( 'EP_VERSION', '1.9.1' );
require_once( 'classes/class-ep-config.php' );
require_once( 'classes/class-ep-api.php' );
require_once( 'classes/class-ep-sync-manager.php' );
require_once( 'classes/class-ep-elasticpress.php' );
require_once( 'classes/class-ep-wp-query-integration.php' );
require_once( 'classes/class-ep-wp-date-query.php' );
// Define a constant if we're network activated to allow plugin to respond accordingly.
$network_activated = ep_is_network_activated( plugin_basename( __FILE__ ) );
if ( $network_activated ) {
define( 'EP_IS_NETWORK', true );
}
/**
* WP CLI Commands
*/
if ( defined( 'WP_CLI' ) && WP_CLI ) {
require_once 'bin/wp-cli.php';
}
add_action( 'plugins_loaded', 'ep_loader' );
/**
* Loads GUI classes if needed.
*/
function ep_loader() {
if ( class_exists( 'EP_Config' ) ) {
load_plugin_textdomain( 'elasticpress', false, basename( dirname( __FILE__ ) ) . '/lang' ); // Load any available translations first.
// Load the settings page.
require_once( dirname( __FILE__ ) . '/classes/class-ep-settings.php' );
new EP_Settings();
// Load the indexing GUI.
if ( true === apply_filters( 'ep_load_index_gui', true ) ) {
require_once( dirname( __FILE__ ) . '/classes/class-ep-index-gui.php' );
new EP_Index_GUI();
}
// Load index statuses.
if ( true === apply_filters( 'ep_load_index_status', true ) ) {
require_once( dirname( __FILE__ ) . '/classes/class-ep-index-status.php' );
new EP_Index_Status();
}
}
if ( is_user_logged_in() && ! defined( 'WP_EP_DEBUG' ) ) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
define( 'WP_EP_DEBUG', is_plugin_active( 'debug-bar-elasticpress/debug-bar-elasticpress.php' ) );
}
}