-
Notifications
You must be signed in to change notification settings - Fork 0
/
dkzr-event-maker-fixes.php
40 lines (39 loc) · 1.39 KB
/
dkzr-event-maker-fixes.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
<?php
/**
* Plugin Name: Event Maker fixes for PHP7.1+
* Version: 1.0
* Description: Fix PHP7.1+ issues in Event Maker plugin
* Author: Joost de Keijzer
* Author URI: https://dkzr.nl
* Plugin URI: https://dkzr.nl
* Update URI: https://api.dkzr.nl/wp/update-check/
*
* 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, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
class dkzrEventMakerFixes {
public function __construct() {
add_action( 'pre_get_posts', [ $this, 'pre_get_posts' ] );
}
/**
* Events_Maker_Query::pre_get_posts expects the meta_query default output
* to be an array.
*/
public function pre_get_posts( $query ) {
if ( ! isset( $query->query_vars[ 'meta_query' ] ) ) {
$query->query_vars[ 'meta_query' ] = [];
}
}
}
$dkzrEventMakerFixes = new dkzrEventMakerFixes();