-
Notifications
You must be signed in to change notification settings - Fork 6
/
wp-es.php
96 lines (82 loc) · 2.39 KB
/
wp-es.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
85
86
87
88
89
90
91
92
93
94
95
96
<?php
/**
* WP Extended Search
*
* @package WPES
* @author 5um17
*
* @wordpress-plugin
* Plugin Name: WP Extended Search
* Plugin URI: https://www.secretsofgeeks.com/2014/09/wordpress-search-tags-and-categories.html
* Author: 5um17
* Author URI: https://www.secretsofgeeks.com
* Text Domain: wp-extended-search
* Version: 2.2
* Requires at least: 4.0
* Requires PHP: 7.0
* Description: Extend search functionality to search in selected post meta, taxonomies, post types, and all authors.
* License: GPLv3
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
defined( 'ABSPATH' ) || exit();
// Define plugin constants.
// Plugin root directory path.
if ( ! defined( 'WPES_DIR' ) ) {
define( 'WPES_DIR', plugin_dir_path( __FILE__ ) );
}
// Include directory path.
if ( ! defined( 'WPES_INCLUDES_PATH' ) ) {
define( 'WPES_INCLUDES_PATH', WPES_DIR . 'includes/' );
}
// Admin directory path.
if ( ! defined( 'WPES_ADMIN_PATH' ) ) {
define( 'WPES_ADMIN_PATH', WPES_INCLUDES_PATH . 'admin/' );
}
// Integration directory path.
if ( ! defined( 'WPES_INTEGRATIONS_PATH' ) ) {
define( 'WPES_INTEGRATIONS_PATH', WPES_INCLUDES_PATH . 'integrations/' );
}
// Assets directory URL.
if ( ! defined( 'WPES_ASSETS_URL' ) ) {
define( 'WPES_ASSETS_URL', plugin_dir_url( __FILE__ ) . 'assets/' );
}
// Plugin main file name.
if ( ! defined( 'WPES_FILENAME' ) ) {
define( 'WPES_FILENAME', plugin_basename( __FILE__ ) );
}
// Includes library files.
require_once WPES_INCLUDES_PATH . '/class-wpes-core.php';
require_once WPES_INCLUDES_PATH . '/class-wpes-search-form.php';
require_once WPES_INCLUDES_PATH . '/class-wpes-search-widget.php';
// Includes admin files.
if ( is_admin() ) {
require_once WPES_ADMIN_PATH . '/class-wpes-admin.php';
require_once WPES_ADMIN_PATH . '/class-wpes-settings-cpt.php';
}
// Public functions.
/**
* WPES functions.
*
* @since 2.0
* @return WPES_Core returns WPES_Core instance.
*/
function WPES() {
return WPES_Core::instance();
}
/**
* Print or return WPES search form.
*
* @since 2.0
* @param array $args Search form arguments.
* @param bool $print true for print false to return. Default true.
* @return string Search form HTML.
*/
function wpes_search_form( $args, $print = true ) {
if ( true == $print ) {
echo WPES()->wpes_search_form->get_search_form( $args );
return;
}
return WPES()->wpes_search_form->get_search_form( $args );
}
// Start the show <3
WPES();