-
Notifications
You must be signed in to change notification settings - Fork 1
/
requirements.php
25 lines (25 loc) · 919 Bytes
/
requirements.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
<?php
function zkapi_requirements(){
$requierements = 0;
if (!function_exists('acf_add_options_page')) {
add_action('admin_notices', 'zkapi_require_plugins_error');
} else {
$requierements++;
}
if (!defined('JWT_AUTH_SECRET_KEY') || !function_exists('run_jwt_auth')) {
add_action('admin_notices', 'zkapi_require_jwt');
}else{
$requierements++;
}
return ($requierements == 2);
}
function zkapi_require_plugins_error() {
$class = 'notice notice-error';
$message = __('ZKAPI need acf', 'zkapi');
printf('<div class="%1$s"><p>%2$s</p></div>', esc_attr($class), esc_html($message));
}
function zkapi_require_jwt(){
$class = 'notice notice-error';
$message = __('You need to install and configure "JWT Authentication for WP REST API"', 'zkapi');
printf('<div class="%1$s"><p>%2$s</p></div>', esc_attr($class), esc_html($message));
}