-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathindex.php
More file actions
97 lines (75 loc) · 2.32 KB
/
index.php
File metadata and controls
97 lines (75 loc) · 2.32 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
<?php
/*
Plugin Name: FacetWP
Description: Advanced Filtering for WordPress
Version: 4.3.1
Author: FacetWP, LLC
Author URI: https://facetwp.com/
Copyright 2024 FacetWP, LLC
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
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, see <http://www.gnu.org/licenses/>.
*/
defined( 'ABSPATH' ) or exit;
class FacetWP
{
private static $instance;
public $filtered_post_ids;
public $unfiltered_post_ids;
public $is_filtered;
public $is_modified;
public $or_values;
public $init;
public $api;
public $helper;
public $facet;
public $settings;
public $diff;
public $indexer;
public $display;
public $builder;
public $request;
public $ajax;
public $acf;
function __construct() {
// php check
if ( version_compare( phpversion(), '7.0', '<' ) ) {
add_action( 'admin_notices', array( $this, 'upgrade_notice' ) );
return;
}
// setup variables
define( 'FACETWP_VERSION', '4.3.1' );
define( 'FACETWP_DIR', dirname( __FILE__ ) );
define( 'FACETWP_URL', plugins_url( '', __FILE__ ) );
define( 'FACETWP_BASENAME', plugin_basename( __FILE__ ) );
// get the gears turning
include( FACETWP_DIR . '/includes/class-init.php' );
}
/**
* Singleton
*/
public static function instance() {
if ( ! isset( self::$instance ) ) {
self::$instance = new self;
}
return self::$instance;
}
/**
* Require PHP 7.0+
*/
function upgrade_notice() {
$message = __( 'FacetWP requires PHP %s or above. Please contact your host and request a PHP upgrade.', 'fwp' );
echo '<div class="error"><p>' . sprintf( $message, '7.0' ) . '</p></div>';
}
}
function FWP() {
return FacetWP::instance();
}
FWP();