PluginProbe
WP Coder – Insert & Manage Code Snippets / 3.4
WP Coder – Insert & Manage Code Snippets v3.4
4.5.1 1.1 2.3.1 2.3.2 2.4.1 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 3.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.1 3.1.1 3.2 3.2.1 3.3 3.4 3.5 3.5.1 All 39 releases
← All changes | classes/Dashboard/Link.php +16 -16 3.0.33.4 View file →
@@ -3,9 +3,9 @@
3 3 namespace WPCoder\Dashboard;
4 4
5 5 defined( 'ABSPATH' ) || exit;
6 6
7 -use WPCoder\WOW_Plugin;
7 +use WPCoder\WPCoder;
8 8
9 9 class Link {
10 10
11 11 public static function create($arg = []): string {
@@ -14,15 +14,15 @@
14 14
15 15 public static function activate_mode($id = 0): string {
16 16 return wp_nonce_url (add_query_arg( [
17 17 'id' => $id,
18 - ], self::link() ), WOW_Plugin::PREFIX . '_nonce', WOW_Plugin::PREFIX . '_activate_mode');
18 + ], self::link() ), WPCoder::PREFIX . '_nonce', WPCoder::PREFIX . '_activate_mode');
19 19 }
20 20
21 21 public static function deactivate_mode($id = 0) {
22 22 return wp_nonce_url (add_query_arg( [
23 23 'id' => $id,
24 - ], self::link() ), WOW_Plugin::PREFIX . '_nonce', WOW_Plugin::PREFIX . '_deactivate_mode');
24 + ], self::link() ), WPCoder::PREFIX . '_nonce', WPCoder::PREFIX . '_deactivate_mode');
25 25 }
26 26
27 27
28 28 public static function activate_url($id = 0) {
@@ -28,9 +28,9 @@
28 28 public static function activate_url($id = 0) {
29 29 return wp_nonce_url (add_query_arg( [
30 30 'id' => $id,
31 31 'action' => 'activate',
32 - ], self::link() ), WOW_Plugin::PREFIX . '_nonce', WOW_Plugin::PREFIX . '_activate_item');
32 + ], self::link() ), WPCoder::PREFIX . '_nonce', WPCoder::PREFIX . '_activate_item');
33 33 }
34 34
35 35 public static function deactivate_url($id = 0) {
36 36 return wp_nonce_url (add_query_arg( [
@@ -35,9 +35,9 @@
35 35 public static function deactivate_url($id = 0) {
36 36 return wp_nonce_url (add_query_arg( [
37 37 'id' => $id,
38 38 'action' => 'deactivate',
39 - ], self::link() ), WOW_Plugin::PREFIX . '_nonce', WOW_Plugin::PREFIX . '_deactivate_item');
39 + ], self::link() ), WPCoder::PREFIX . '_nonce', WPCoder::PREFIX . '_deactivate_item');
40 40 }
41 41
42 42 public static function remove_item() {
43 43 return add_query_arg( [
@@ -47,22 +47,22 @@
47 47 }
48 48
49 49 public static function save_item( $id ) {
50 50 return add_query_arg( [
51 - 'tab' => 'settings',
51 + 'page' => WPCoder::SLUG . '-settings',
52 52 'action' => 'update',
53 53 'id' => $id,
54 54 'notice' => 'save_item',
55 - ], self::link() );
55 + ], admin_url( 'admin.php' ) );
56 56 }
57 57
58 58 public static function menu( $page, $action, $id ): string {
59 59 if ( ! empty( $id ) && $action === 'update' ) {
60 60 return add_query_arg( [
61 - 'tab' => $page,
61 + 'page' => WPCoder::SLUG . '-settings',
62 62 'action' => 'update',
63 63 'id' => $id,
64 - ], self::link() );
64 + ], admin_url( 'admin.php' ) );
65 65 }
66 66
67 67 return add_query_arg( [
68 68 'tab' => $page,
@@ -74,12 +74,12 @@
74 74 return false;
75 75 }
76 76
77 77 return add_query_arg( [
78 + 'page' => WPCoder::SLUG . '-settings',
78 79 'action' => 'update',
79 - 'tab' => 'settings',
80 80 'id' => $id
81 - ], self::link() );
81 + ], admin_url( 'admin.php' ) );
82 82 }
83 83
84 84 public static function duplicate( $id ) {
85 85 if ( ! $id ) {
@@ -86,12 +86,12 @@
86 86 return false;
87 87 }
88 88
89 89 return add_query_arg( [
90 + 'page' => WPCoder::SLUG . '-settings',
90 91 'action' => 'duplicate',
91 - 'tab' => 'settings',
92 92 'id' => $id
93 - ], self::link() );
93 + ], admin_url( 'admin.php' ) );
94 94 }
95 95
96 96 public static function export( $id ) {
97 97 if ( ! $id ) {
@@ -100,9 +100,9 @@
100 100
101 101 return wp_nonce_url( add_query_arg( [
102 102 'action' => 'export',
103 103 'id' => $id
104 - ], self::link() ), WOW_Plugin::PREFIX . '_nonce', WOW_Plugin::PREFIX . '_export_item' );
104 + ], self::link() ), WPCoder::PREFIX . '_nonce', WPCoder::PREFIX . '_export_item' );
105 105 }
106 106
107 107 public static function remove( $id ) {
108 108 if ( ! $id ) {
@@ -111,12 +111,12 @@
111 111
112 112 return wp_nonce_url( add_query_arg( [
113 113 'action' => 'delete',
114 114 'id' => $id
115 - ], self::link() ), WOW_Plugin::PREFIX . '_nonce', WOW_Plugin::PREFIX . '_remove_item' );
115 + ], self::link() ), WPCoder::PREFIX . '_nonce', WPCoder::PREFIX . '_remove_item' );
116 116 }
117 117
118 118 private static function link(): string {
119 - return add_query_arg( [ 'page' => WOW_Plugin::SLUG ], admin_url( 'admin.php' ) );
119 + return add_query_arg( [ 'page' => WPCoder::SLUG ], admin_url( 'admin.php' ) );
120 120 }
121 121
122 122 }