-
Notifications
You must be signed in to change notification settings - Fork 10
/
combined-query.php
42 lines (35 loc) · 988 Bytes
/
combined-query.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
<?php
/**
* Plugin Name: Combined Query
* Description: This plugin allows you to combine multiple WP_Query() queries, into a single one.
* Plugin URI: https://github.com/birgire/wp-combined-queries
* Author: birgire
* GitHub Plugin URI: https://github.com/birgire/wp-combined-queries.git
* Author URI: https://github.com/birgire
* License: MIT
* Version: 1.2.2
*/
namespace CombinedQuery;
/**
* Init.
*/
add_action(
'init',
function() {
global $wpdb;
// Composer autoload.
if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
require __DIR__ . '/vendor/autoload.php';
}
// Fallback for those who don't use Composer.
else {
require_once __DIR__ . '/includes/Main.php';
require_once __DIR__ . '/includes/Generator.php';
require_once __DIR__ . '/includes/EmptyQuery.php';
}
if ( class_exists( __NAMESPACE__ . '\\Main' ) ) {
$main = new Main();
$main->init( new Generator( new EmptyQuery() ), $wpdb );
}
}
);