search-filter-pro.php
4.53 KB
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<?php
/**
* Search & Filter Pro
*
* @package Search_Filter
* @author Ross Morsali
* @link https://searchandfilter.com
* @copyright 2018 Search & Filter
*
* @wordpress-plugin
* Plugin Name: Search & Filter Pro
* Plugin URI: https://searchandfilter.com
* Description: Search & Filtering for posts, products and custom posts. Allow your users to Search & Filter by categories, tags, taxonomies, custom fields, post meta, post dates, post types and authors.
* Version: 2.5.16
* Author: Code Amp
* Author URI: http://www.codeamp.com
* Text Domain: search-filter
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
* Domain Path: /languages
*/
// If this file is called directly, abort.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! defined( 'SEARCH_FILTER_DEBUG' ) ) {
define( 'SEARCH_FILTER_DEBUG', false );
}
if ( ! defined( 'SEARCH_FILTER_QUERY_DEBUG' ) ) {
define( 'SEARCH_FILTER_QUERY_DEBUG', false );
}
if ( ! defined( 'SEARCH_FILTER_VERSION' ) ) {
define( 'SEARCH_FILTER_VERSION', '2.5.16' );
}
if ( ! defined( 'SEARCH_FILTER_PRO_BASE_PATH' ) ) {
define( 'SEARCH_FILTER_PRO_BASE_PATH', __FILE__ );
}
/*
----------------------------------------------------------------------------*
* Public-Facing Functionality
*----------------------------------------------------------------------------*/
/**
* The code that runs during plugin activation.
*/
function activate_search_filter( $network_wide ) {
require_once plugin_dir_path( __FILE__ ) . 'includes/class-search-filter-activator.php';
$search_filter_activator = new Search_Filter_Activator(); // correct
$search_filter_activator->activate( $network_wide );
}
/**
* The code that runs during plugin deactivation.
*/
function deactivate_search_filter( $network_wide ) {
require_once plugin_dir_path( __FILE__ ) . 'includes/class-search-filter-deactivator.php';
Search_Filter_Deactivator::deactivate( $network_wide );
}
register_activation_hook( __FILE__, 'activate_search_filter' );
register_deactivation_hook( __FILE__, 'deactivate_search_filter' );
if ( ( ! is_admin() ) || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
require_once plugin_dir_path( __FILE__ ) . 'public/class-search-filter.php';
add_action( 'plugins_loaded', array( 'Search_Filter', 'get_instance' ) );
}
/*
----------------------------------------------------------------------------*
* Dashboard and Administrative Functionality
*----------------------------------------------------------------------------*/
if ( is_admin() ) {
require_once plugin_dir_path( __FILE__ ) . 'admin/class-search-filter-admin.php';
add_action( 'plugins_loaded', array( 'Search_Filter_Admin', 'get_instance' ) );
}
if ( ! class_exists( 'Search_Filter_Register_Widget' ) ) {
require_once plugin_dir_path( __FILE__ ) . 'includes/class-search-filter-register-widget.php';
}
if ( ! class_exists( 'Search_Filter_Post_Cache' ) ) {
require_once plugin_dir_path( __FILE__ ) . 'includes/class-search-filter-post-cache.php';
}
if ( ! class_exists( 'Search_Filter_Wp_Cache' ) ) {
require_once plugin_dir_path( __FILE__ ) . 'includes/class-search-filter-wp-cache.php';
}
if ( ! class_exists( 'Search_Filter_Wp_Data' ) ) {
require_once plugin_dir_path( __FILE__ ) . 'includes/class-search-filter-wp-data.php';
}
if ( ! class_exists( 'Search_Filter_Helper' ) ) {
require_once plugin_dir_path( __FILE__ ) . 'includes/class-search-filter-helper.php';
}
if ( ! class_exists( 'Search_Filter_Shared' ) ) {
require_once plugin_dir_path( __FILE__ ) . 'includes/class-search-filter-shared.php';
}
if ( ! class_exists( 'Search_Filter_Third_Party' ) ) {
require_once plugin_dir_path( __FILE__ ) . 'includes/class-search-filter-third-party.php';
}
if ( ! defined( 'SF_FPRE' ) ) {
define( 'SF_FPRE', '_sf_' );
}
if ( ! defined( 'SF_TAX_PRE' ) ) {
define( 'SF_TAX_PRE', '_sft_' );
}
if ( ! defined( 'SF_META_PRE' ) ) {
define( 'SF_META_PRE', '_sfm_' );
}
if ( ! defined( 'SF_CLASS_PRE' ) ) {
define( 'SF_CLASS_PRE', 'sf-' );
}
if ( ! defined( 'SF_INPUT_ID_PRE' ) ) {
define( 'SF_INPUT_ID_PRE', 'sf' );
}
if ( ! defined( 'SF_FIELD_CLASS_PRE' ) ) {
define( 'SF_FIELD_CLASS_PRE', SF_CLASS_PRE . 'field-' );
}
if ( ! defined( 'SF_ITEM_CLASS_PRE' ) ) {
define( 'SF_ITEM_CLASS_PRE', SF_CLASS_PRE . 'item-' );
}
global $search_filter_post_cache;
$search_filter_post_cache = new Search_Filter_Post_Cache();
global $search_filter_third_party;
$search_filter_third_party = new Search_Filter_Third_Party();
global $search_filter_shared;
$search_filter_shared = new Search_Filter_Shared();