|
9 | 9 | * Display admin notice Users add-on is installed. |
10 | 10 | */ |
11 | 11 | function alm_users_extension_pro_admin_notice() { |
12 | | - $slug = 'ajax-load-more'; |
13 | | - $plugin = $slug . '-for-users'; |
14 | 12 | // Ajax Load More Notice. |
15 | 13 | if ( get_transient( 'alm_users_extension_pro_admin_notice' ) ) { |
16 | | - $install_url = get_admin_url() . '/update.php?action=install-plugin&plugin=' . $slug . '&_wpnonce=' . wp_create_nonce( 'install-plugin_' . $slug ); |
17 | | - $message = '<div class="error">'; |
18 | | - $message .= '<p>You must deactivate the Users add-on in Ajax Load More Pro or update the Pro add-on before installing the Users extension.</p>'; |
19 | | - $message .= '<p><a href="./plugins.php">Back to Plugins</a></p>'; |
20 | | - $message .= '</div>'; |
| 14 | + $message = '<div class="error">'; |
| 15 | + $message .= '<p>You must deactivate the Users add-on in Ajax Load More Pro or update the Pro add-on before installing the Users extension.</p>'; |
| 16 | + $message .= '<p><a href="./plugins.php">Back to Plugins</a></p>'; |
| 17 | + $message .= '</div>'; |
21 | 18 | echo wp_kses_post( $message ); |
22 | 19 | delete_transient( 'alm_users_extension_pro_admin_notice' ); |
23 | 20 | wp_die(); |
24 | 21 | } |
25 | 22 | } |
26 | 23 | add_action( 'admin_notices', 'alm_users_extension_pro_admin_notice' ); |
27 | | - |
28 | | -/** |
29 | | - * Display admin notice if plugin does not meet the requirements. |
30 | | - */ |
31 | | -function alm_users_extension_admin_notice() { |
32 | | - $slug = 'ajax-load-more'; |
33 | | - $plugin = $slug . '-for-users'; |
34 | | - // Ajax Load More Notice. |
35 | | - if ( get_transient( 'alm_users_extension_admin_notice' ) ) { |
36 | | - $install_url = get_admin_url() . '/update.php?action=install-plugin&plugin=' . $slug . '&_wpnonce=' . wp_create_nonce( 'install-plugin_' . $slug ); |
37 | | - $message = '<div class="error">'; |
38 | | - $message .= '<p>You must install and activate the core Ajax Load More plugin before using the Ajax Load More Users extension.</p>'; |
39 | | - $message .= '<p>' . sprintf( '<a href="%s" class="button-primary">%s</a>', $install_url, 'Install Ajax Load More Now' ) . '</p>'; |
40 | | - $message .= '</div>'; |
41 | | - echo wp_kses_post( $message ); |
42 | | - delete_transient( 'alm_users_extension_admin_notice' ); |
43 | | - } |
44 | | -} |
45 | | -add_action( 'admin_notices', 'alm_users_extension_admin_notice' ); |
0 commit comments