-
Notifications
You must be signed in to change notification settings - Fork 0
/
gravityview-az-filters.php
57 lines (48 loc) · 1.73 KB
/
gravityview-az-filters.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
<?php
/**
* Plugin Name: GravityView - A-Z Filters Extension
* Plugin URI: https://www.gravitykit.com/extensions/a-z-filter/
* Description: Filter your entries by letters of the alphabet.
* Version: 1.4.1
* Author: GravityKit
* Author URI: https://www.gravitykit.com
* Text Domain: gravityview-az-filters
* License: GPLv3 or later
* License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
/** @since 1.2 */
define( 'GRAVITYVIEW_AZ_FILTER_VERSION', '1.4.1' );
/** @since 1.3.2 */
define( 'GRAVITYVIEW_AZ_FILTER_FILE', __FILE__ );
add_action( 'plugins_loaded', function () {
if ( class_exists( 'GV\Extension' ) ) {
return;
}
add_action( 'admin_notices', function () {
$message = wpautop(
strtr(
esc_html_x( '[extension] requires [link][plugin][/link] to work. Please install and activate [plugin].', 'gravityview-az-filters' ),
[
'[extension]' => 'GravityView A-Z Filters Extension',
'[plugin]' => 'GravityView',
'[link]' => '<a href="https://www.gravitykit.com/products/gravityview/">',
'[/link]' => '</a>',
]
)
);
echo "<div class='error' style='padding: 1.25em 0 1.25em 1em;'>$message</div>";
} );
} );
// Load the extension & register it with Foundation, which enables translations and other features.
add_action( 'gravityview/loaded', function () {
if ( ! class_exists( 'GV\A_Z_Entry_Filter_Extension' ) ) {
require __DIR__ . '/gravityview-az-filters-extension.php';
}
if ( ! class_exists( 'GravityKit\GravityView\Foundation\Core' ) ) {
return;
}
GravityKit\GravityView\Foundation\Core::register( __FILE__ );
} );