PluginProbe
SendWP / 0.0.2
SendWP v0.0.2
trunk 0.0.1 0.0.2 0.0.3 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.1 1.2.10 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3 1.3.1 1.4.4 1.4.5 1.4.6 1.4.8
← All changes | includes/admin/load.php +28 -31 1.2.90.0.2 View file →
@@ -1,31 +1,28 @@
1 -<?php
2 -
3 -add_action(
4 - 'admin_menu',
5 - function () {
6 - $menu_title = __( 'SendWP', 'sendwp' );
7 - $page_title = $menu_title;
8 - $capability = 'manage_options';
9 - $menu_slug = 'sendwp';
10 - $function = function () {
11 - do_action( 'sendwp_heartbeat' );
12 -
13 - $vars = array(
14 - 'enabled' => __( 'SendWP is currently enabled and sending email.', 'sendwp' ),
15 - 'disabled' => __( 'SendWP is currently disabled and NOT sending email.', 'sendwp' ),
16 - 'loading' => __( 'Loading', 'sendwp' ) . '...',
17 - 'ajaxNonce' => wp_create_nonce( 'sendwp_settings_nonce' ),
18 - );
19 -
20 - include 'views/menu.html.php';
21 -
22 - wp_enqueue_script( 'sendwp-settings', plugins_url( 'assets/js/admin/settings.js', dirname( __DIR__ ) ) );
23 - wp_localize_script( 'sendwp-settings', 'sendwpAdmin', $vars );
24 - wp_enqueue_style( 'sendwp-settings', plugins_url( 'assets/css/admin/settings.css', dirname( __DIR__ ) ) );
25 - };
26 -
27 - $position = 100; // After bottom seperator.
28 -
29 - add_submenu_page( 'tools.php', $page_title, $menu_title, $capability, $menu_slug, $function, $position );
30 - }
31 -);
1 +<?php
2 +
3 +add_action( 'admin_menu', function () {
4 + $page_title = $menu_title = __( 'SendWP', 'sendwp' );
5 + $capability = 'manage_options';
6 + $menu_slug = 'sendwp';
7 + $function = function () {
8 + do_action('sendwp_heartbeat');
9 + $vars = [
10 + 'enabled' => __('SendWP is currently enabled and sending email.', 'sendwp'),
11 + 'disabled' => __('SendWP is currently disabled and NOT sending email.', 'sendwp'),
12 + 'loading' => __('Loading', 'sendwp') . '...',
13 + 'ajaxNonce' => wp_create_nonce( 'sendwp_settings_nonce' )
14 + ];
15 + include 'views/menu.html.php';
16 + wp_enqueue_script('sendwp-settings', plugins_url( 'assets/js/admin/settings.js', dirname(__DIR__)));
17 + wp_localize_script('sendwp-settings', 'sendwpAdmin', $vars);
18 + wp_enqueue_style('sendwp-settings', plugins_url( 'assets/css/admin/settings.css', dirname(__DIR__)));
19 + };
20 + $icon = 'dashicons-email';
21 + $position = 100; // After bottom seperator.
22 +
23 + if(!sendwp_forwarding_enabled()){
24 + $menu_title .= '&nbsp;<span class="update-plugins"><span class="update-count">!</span></span>';
25 + }
26 +
27 + add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon, $position );
28 +} );