-
Notifications
You must be signed in to change notification settings - Fork 0
/
gravityview-dashboard-views.php
54 lines (45 loc) · 1.67 KB
/
gravityview-dashboard-views.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
<?php
/**
* Plugin Name: GravityView - Dashboard Views
* Plugin URI: https://www.gravitykit.com/products/dashboard-views/
* Description: Display Views in the WordPress Dashboard.
* Version: 2.0.1
* Author: GravityKit
* Author URI: https://www.gravitykit.com
* Text Domain: gk-gravityview-dashboard-views
* License: GPLv2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.en.html
*/
require_once __DIR__ . '/vendor/autoload.php';
define( 'GV_DASHBOARD_VIEWS_VERSION', '2.0.1' );
define( 'GV_DASHBOARD_VIEWS_PLUGIN_FILE', __FILE__ );
add_action(
'gravityview/loaded',
function () {
$required_gv_version = '2.23';
if ( ! defined( 'GV_PLUGIN_VERSION' ) || version_compare( GV_PLUGIN_VERSION, $required_gv_version, '<' ) ) {
add_action(
'admin_notices',
function () use ( $required_gv_version ) {
$notice = wpautop(
strtr(
esc_html__( '[plugin] requires [requirement] [version] or newer.', 'gk-gravityview-dashboard-views' ),
[
'[plugin]' => 'Dashboard Views',
'[requirement]' => '<a href="https://www.gravitykit.com/products/gravityview/">GravityView</a>',
'[version]' => $required_gv_version,
]
)
);
echo "<div class='error' style='padding: 1.25em 0 1.25em 1em;'>$notice</div>"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
);
return;
}
if ( ! class_exists( 'GravityKit\GravityView\Foundation\Core' ) ) {
return;
}
GravityKit\GravityView\Foundation\Core::register( GV_DASHBOARD_VIEWS_PLUGIN_FILE );
new GravityKit\GravityView\DashboardViews\Plugin();
}
);