author | ymh <ymh.work@gmail.com> |
Mon, 08 Sep 2025 19:44:41 +0200 | |
changeset 23 | 417f20492bf7 |
parent 22 | 8c2e4d02f4ef |
permissions | -rw-r--r-- |
0 | 1 |
<?php |
2 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
3 |
* List Table API: WP_Plugins_List_Table class |
0 | 4 |
* |
5 |
* @package WordPress |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
6 |
* @subpackage Administration |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
7 |
* @since 3.1.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
8 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
9 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
10 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
11 |
* Core class used to implement displaying installed plugins in a list table. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
12 |
* |
0 | 13 |
* @since 3.1.0 |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
14 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
15 |
* @see WP_List_Table |
0 | 16 |
*/ |
17 |
class WP_Plugins_List_Table extends WP_List_Table { |
|
16 | 18 |
/** |
19 |
* Whether to show the auto-updates UI. |
|
20 |
* |
|
21 |
* @since 5.5.0 |
|
22 |
* |
|
23 |
* @var bool True if auto-updates UI is to be shown, false otherwise. |
|
24 |
*/ |
|
25 |
protected $show_autoupdates = true; |
|
0 | 26 |
|
5 | 27 |
/** |
28 |
* Constructor. |
|
29 |
* |
|
30 |
* @since 3.1.0 |
|
31 |
* |
|
32 |
* @see WP_List_Table::__construct() for more information on default arguments. |
|
33 |
* |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
34 |
* @global string $status |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
35 |
* @global int $page |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
36 |
* |
5 | 37 |
* @param array $args An associative array of arguments. |
38 |
*/ |
|
39 |
public function __construct( $args = array() ) { |
|
0 | 40 |
global $status, $page; |
41 |
||
9 | 42 |
parent::__construct( |
43 |
array( |
|
44 |
'plural' => 'plugins', |
|
45 |
'screen' => isset( $args['screen'] ) ? $args['screen'] : null, |
|
46 |
) |
|
47 |
); |
|
0 | 48 |
|
16 | 49 |
$allowed_statuses = array( 'active', 'inactive', 'recently_activated', 'upgrade', 'mustuse', 'dropins', 'search', 'paused', 'auto-update-enabled', 'auto-update-disabled' ); |
50 |
||
0 | 51 |
$status = 'all'; |
16 | 52 |
if ( isset( $_REQUEST['plugin_status'] ) && in_array( $_REQUEST['plugin_status'], $allowed_statuses, true ) ) { |
0 | 53 |
$status = $_REQUEST['plugin_status']; |
9 | 54 |
} |
0 | 55 |
|
9 | 56 |
if ( isset( $_REQUEST['s'] ) ) { |
57 |
$_SERVER['REQUEST_URI'] = add_query_arg( 's', wp_unslash( $_REQUEST['s'] ) ); |
|
58 |
} |
|
0 | 59 |
|
60 |
$page = $this->get_pagenum(); |
|
16 | 61 |
|
62 |
$this->show_autoupdates = wp_is_auto_update_enabled_for_type( 'plugin' ) |
|
63 |
&& current_user_can( 'update_plugins' ) |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
64 |
&& ( ! is_multisite() || $this->screen->in_admin( 'network' ) ); |
0 | 65 |
} |
66 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
67 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
68 |
* @return array |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
69 |
*/ |
5 | 70 |
protected function get_table_classes() { |
0 | 71 |
return array( 'widefat', $this->_args['plural'] ); |
72 |
} |
|
73 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
74 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
75 |
* @return bool |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
76 |
*/ |
5 | 77 |
public function ajax_user_can() { |
9 | 78 |
return current_user_can( 'activate_plugins' ); |
0 | 79 |
} |
80 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
81 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
82 |
* @global string $status |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
83 |
* @global array $plugins |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
84 |
* @global array $totals |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
85 |
* @global int $page |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
86 |
* @global string $orderby |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
87 |
* @global string $order |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
88 |
* @global string $s |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
89 |
*/ |
5 | 90 |
public function prepare_items() { |
0 | 91 |
global $status, $plugins, $totals, $page, $orderby, $order, $s; |
92 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
93 |
$orderby = ! empty( $_REQUEST['orderby'] ) ? sanitize_text_field( $_REQUEST['orderby'] ) : ''; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
94 |
$order = ! empty( $_REQUEST['order'] ) ? sanitize_text_field( $_REQUEST['order'] ) : ''; |
0 | 95 |
|
5 | 96 |
/** |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
97 |
* Filters the full array of plugins to list in the Plugins list table. |
5 | 98 |
* |
99 |
* @since 3.0.0 |
|
100 |
* |
|
101 |
* @see get_plugins() |
|
102 |
* |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
103 |
* @param array $all_plugins An array of plugins to display in the list table. |
5 | 104 |
*/ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
105 |
$all_plugins = apply_filters( 'all_plugins', get_plugins() ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
106 |
|
0 | 107 |
$plugins = array( |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
108 |
'all' => $all_plugins, |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
109 |
'search' => array(), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
110 |
'active' => array(), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
111 |
'inactive' => array(), |
0 | 112 |
'recently_activated' => array(), |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
113 |
'upgrade' => array(), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
114 |
'mustuse' => array(), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
115 |
'dropins' => array(), |
9 | 116 |
'paused' => array(), |
0 | 117 |
); |
16 | 118 |
if ( $this->show_autoupdates ) { |
119 |
$auto_updates = (array) get_site_option( 'auto_update_plugins', array() ); |
|
120 |
||
121 |
$plugins['auto-update-enabled'] = array(); |
|
122 |
$plugins['auto-update-disabled'] = array(); |
|
123 |
} |
|
0 | 124 |
|
125 |
$screen = $this->screen; |
|
126 |
||
127 |
if ( ! is_multisite() || ( $screen->in_admin( 'network' ) && current_user_can( 'manage_network_plugins' ) ) ) { |
|
5 | 128 |
|
129 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
130 |
* Filters whether to display the advanced plugins list table. |
5 | 131 |
* |
132 |
* There are two types of advanced plugins - must-use and drop-ins - |
|
133 |
* which can be used in a single site or Multisite network. |
|
134 |
* |
|
135 |
* The $type parameter allows you to differentiate between the type of advanced |
|
136 |
* plugins to filter the display of. Contexts include 'mustuse' and 'dropins'. |
|
137 |
* |
|
138 |
* @since 3.0.0 |
|
139 |
* |
|
140 |
* @param bool $show Whether to show the advanced plugins for the specified |
|
141 |
* plugin type. Default true. |
|
142 |
* @param string $type The plugin type. Accepts 'mustuse', 'dropins'. |
|
143 |
*/ |
|
144 |
if ( apply_filters( 'show_advanced_plugins', true, 'mustuse' ) ) { |
|
0 | 145 |
$plugins['mustuse'] = get_mu_plugins(); |
5 | 146 |
} |
147 |
||
148 |
/** This action is documented in wp-admin/includes/class-wp-plugins-list-table.php */ |
|
9 | 149 |
if ( apply_filters( 'show_advanced_plugins', true, 'dropins' ) ) { |
0 | 150 |
$plugins['dropins'] = get_dropins(); |
9 | 151 |
} |
0 | 152 |
|
153 |
if ( current_user_can( 'update_plugins' ) ) { |
|
154 |
$current = get_site_transient( 'update_plugins' ); |
|
155 |
foreach ( (array) $plugins['all'] as $plugin_file => $plugin_data ) { |
|
156 |
if ( isset( $current->response[ $plugin_file ] ) ) { |
|
157 |
$plugins['all'][ $plugin_file ]['update'] = true; |
|
9 | 158 |
$plugins['upgrade'][ $plugin_file ] = $plugins['all'][ $plugin_file ]; |
0 | 159 |
} |
160 |
} |
|
161 |
} |
|
162 |
} |
|
163 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
164 |
if ( ! $screen->in_admin( 'network' ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
165 |
$show = current_user_can( 'manage_network_plugins' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
166 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
167 |
* Filters whether to display network-active plugins alongside plugins active for the current site. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
168 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
169 |
* This also controls the display of inactive network-only plugins (plugins with |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
170 |
* "Network: true" in the plugin header). |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
171 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
172 |
* Plugins cannot be network-activated or network-deactivated from this screen. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
173 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
174 |
* @since 4.4.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
175 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
176 |
* @param bool $show Whether to show network-active plugins. Default is whether the current |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
177 |
* user can manage network plugins (ie. a Super Admin). |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
178 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
179 |
$show_network_active = apply_filters( 'show_network_active_plugins', $show ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
180 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
181 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
182 |
if ( $screen->in_admin( 'network' ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
183 |
$recently_activated = get_site_option( 'recently_activated', array() ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
184 |
} else { |
0 | 185 |
$recently_activated = get_option( 'recently_activated', array() ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
186 |
} |
0 | 187 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
188 |
foreach ( $recently_activated as $key => $time ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
189 |
if ( $time + WEEK_IN_SECONDS < time() ) { |
9 | 190 |
unset( $recently_activated[ $key ] ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
191 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
192 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
193 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
194 |
if ( $screen->in_admin( 'network' ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
195 |
update_site_option( 'recently_activated', $recently_activated ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
196 |
} else { |
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
197 |
update_option( 'recently_activated', $recently_activated, false ); |
0 | 198 |
} |
199 |
||
5 | 200 |
$plugin_info = get_site_transient( 'update_plugins' ); |
201 |
||
0 | 202 |
foreach ( (array) $plugins['all'] as $plugin_file => $plugin_data ) { |
5 | 203 |
// Extra info if known. array_merge() ensures $plugin_data has precedence if keys collide. |
204 |
if ( isset( $plugin_info->response[ $plugin_file ] ) ) { |
|
16 | 205 |
$plugin_data = array_merge( (array) $plugin_info->response[ $plugin_file ], array( 'update-supported' => true ), $plugin_data ); |
5 | 206 |
} elseif ( isset( $plugin_info->no_update[ $plugin_file ] ) ) { |
16 | 207 |
$plugin_data = array_merge( (array) $plugin_info->no_update[ $plugin_file ], array( 'update-supported' => true ), $plugin_data ); |
208 |
} elseif ( empty( $plugin_data['update-supported'] ) ) { |
|
209 |
$plugin_data['update-supported'] = false; |
|
5 | 210 |
} |
211 |
||
16 | 212 |
/* |
213 |
* Create the payload that's used for the auto_update_plugin filter. |
|
214 |
* This is the same data contained within $plugin_info->(response|no_update) however |
|
215 |
* not all plugins will be contained in those keys, this avoids unexpected warnings. |
|
216 |
*/ |
|
217 |
$filter_payload = array( |
|
218 |
'id' => $plugin_file, |
|
219 |
'slug' => '', |
|
220 |
'plugin' => $plugin_file, |
|
221 |
'new_version' => '', |
|
222 |
'url' => '', |
|
223 |
'package' => '', |
|
224 |
'icons' => array(), |
|
225 |
'banners' => array(), |
|
226 |
'banners_rtl' => array(), |
|
227 |
'tested' => '', |
|
228 |
'requires_php' => '', |
|
229 |
'compatibility' => new stdClass(), |
|
230 |
); |
|
231 |
||
18 | 232 |
$filter_payload = (object) wp_parse_args( $plugin_data, $filter_payload ); |
233 |
||
234 |
$auto_update_forced = wp_is_auto_update_forced_for_item( 'plugin', null, $filter_payload ); |
|
16 | 235 |
|
236 |
if ( ! is_null( $auto_update_forced ) ) { |
|
237 |
$plugin_data['auto-update-forced'] = $auto_update_forced; |
|
238 |
} |
|
239 |
||
240 |
$plugins['all'][ $plugin_file ] = $plugin_data; |
|
241 |
// Make sure that $plugins['upgrade'] also receives the extra info since it is used on ?plugin_status=upgrade. |
|
242 |
if ( isset( $plugins['upgrade'][ $plugin_file ] ) ) { |
|
243 |
$plugins['upgrade'][ $plugin_file ] = $plugin_data; |
|
244 |
} |
|
245 |
||
246 |
// Filter into individual sections. |
|
5 | 247 |
if ( is_multisite() && ! $screen->in_admin( 'network' ) && is_network_only_plugin( $plugin_file ) && ! is_plugin_active( $plugin_file ) ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
248 |
if ( $show_network_active ) { |
16 | 249 |
// On the non-network screen, show inactive network-only plugins if allowed. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
250 |
$plugins['inactive'][ $plugin_file ] = $plugin_data; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
251 |
} else { |
16 | 252 |
// On the non-network screen, filter out network-only plugins as long as they're not individually active. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
253 |
unset( $plugins['all'][ $plugin_file ] ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
254 |
} |
0 | 255 |
} elseif ( ! $screen->in_admin( 'network' ) && is_plugin_active_for_network( $plugin_file ) ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
256 |
if ( $show_network_active ) { |
16 | 257 |
// On the non-network screen, show network-active plugins if allowed. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
258 |
$plugins['active'][ $plugin_file ] = $plugin_data; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
259 |
} else { |
16 | 260 |
// On the non-network screen, filter out network-active plugins. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
261 |
unset( $plugins['all'][ $plugin_file ] ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
262 |
} |
0 | 263 |
} elseif ( ( ! $screen->in_admin( 'network' ) && is_plugin_active( $plugin_file ) ) |
264 |
|| ( $screen->in_admin( 'network' ) && is_plugin_active_for_network( $plugin_file ) ) ) { |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
265 |
/* |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
266 |
* On the non-network screen, populate the active list with plugins that are individually activated. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
267 |
* On the network admin screen, populate the active list with plugins that are network-activated. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
268 |
*/ |
0 | 269 |
$plugins['active'][ $plugin_file ] = $plugin_data; |
9 | 270 |
|
271 |
if ( ! $screen->in_admin( 'network' ) && is_plugin_paused( $plugin_file ) ) { |
|
272 |
$plugins['paused'][ $plugin_file ] = $plugin_data; |
|
273 |
} |
|
0 | 274 |
} else { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
275 |
if ( isset( $recently_activated[ $plugin_file ] ) ) { |
16 | 276 |
// Populate the recently activated list with plugins that have been recently activated. |
0 | 277 |
$plugins['recently_activated'][ $plugin_file ] = $plugin_data; |
5 | 278 |
} |
16 | 279 |
// Populate the inactive list with plugins that aren't activated. |
0 | 280 |
$plugins['inactive'][ $plugin_file ] = $plugin_data; |
281 |
} |
|
16 | 282 |
|
283 |
if ( $this->show_autoupdates ) { |
|
284 |
$enabled = in_array( $plugin_file, $auto_updates, true ) && $plugin_data['update-supported']; |
|
285 |
if ( isset( $plugin_data['auto-update-forced'] ) ) { |
|
286 |
$enabled = (bool) $plugin_data['auto-update-forced']; |
|
287 |
} |
|
288 |
||
289 |
if ( $enabled ) { |
|
290 |
$plugins['auto-update-enabled'][ $plugin_file ] = $plugin_data; |
|
291 |
} else { |
|
292 |
$plugins['auto-update-disabled'][ $plugin_file ] = $plugin_data; |
|
293 |
} |
|
294 |
} |
|
0 | 295 |
} |
296 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
297 |
if ( strlen( $s ) ) { |
9 | 298 |
$status = 'search'; |
0 | 299 |
$plugins['search'] = array_filter( $plugins['all'], array( $this, '_search_callback' ) ); |
300 |
} |
|
301 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
302 |
/** |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
303 |
* Filters the array of plugins for the list table. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
304 |
* |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
305 |
* @since 6.3.0 |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
306 |
* |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
307 |
* @param array[] $plugins An array of arrays of plugin data, keyed by context. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
308 |
*/ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
309 |
$plugins = apply_filters( 'plugins_list', $plugins ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
310 |
|
0 | 311 |
$totals = array(); |
9 | 312 |
foreach ( $plugins as $type => $list ) { |
0 | 313 |
$totals[ $type ] = count( $list ); |
9 | 314 |
} |
0 | 315 |
|
16 | 316 |
if ( empty( $plugins[ $status ] ) && ! in_array( $status, array( 'all', 'search' ), true ) ) { |
0 | 317 |
$status = 'all'; |
9 | 318 |
} |
0 | 319 |
|
320 |
$this->items = array(); |
|
321 |
foreach ( $plugins[ $status ] as $plugin_file => $plugin_data ) { |
|
16 | 322 |
// Translate, don't apply markup, sanitize HTML. |
9 | 323 |
$this->items[ $plugin_file ] = _get_plugin_data_markup_translate( $plugin_file, $plugin_data, false, true ); |
0 | 324 |
} |
325 |
||
326 |
$total_this_page = $totals[ $status ]; |
|
327 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
328 |
$js_plugins = array(); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
329 |
foreach ( $plugins as $key => $list ) { |
18 | 330 |
$js_plugins[ $key ] = array_keys( $list ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
331 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
332 |
|
9 | 333 |
wp_localize_script( |
334 |
'updates', |
|
335 |
'_wpUpdatesItemCounts', |
|
336 |
array( |
|
337 |
'plugins' => $js_plugins, |
|
338 |
'totals' => wp_get_update_data(), |
|
339 |
) |
|
340 |
); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
341 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
342 |
if ( ! $orderby ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
343 |
$orderby = 'Name'; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
344 |
} else { |
0 | 345 |
$orderby = ucfirst( $orderby ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
346 |
} |
0 | 347 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
348 |
$order = strtoupper( $order ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
349 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
350 |
uasort( $this->items, array( $this, '_order_callback' ) ); |
0 | 351 |
|
352 |
$plugins_per_page = $this->get_items_per_page( str_replace( '-', '_', $screen->id . '_per_page' ), 999 ); |
|
353 |
||
354 |
$start = ( $page - 1 ) * $plugins_per_page; |
|
355 |
||
9 | 356 |
if ( $total_this_page > $plugins_per_page ) { |
0 | 357 |
$this->items = array_slice( $this->items, $start, $plugins_per_page ); |
9 | 358 |
} |
0 | 359 |
|
9 | 360 |
$this->set_pagination_args( |
361 |
array( |
|
362 |
'total_items' => $total_this_page, |
|
363 |
'per_page' => $plugins_per_page, |
|
364 |
) |
|
365 |
); |
|
0 | 366 |
} |
367 |
||
5 | 368 |
/** |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
369 |
* @global string $s URL encoded search term. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
370 |
* |
5 | 371 |
* @param array $plugin |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
372 |
* @return bool |
5 | 373 |
*/ |
374 |
public function _search_callback( $plugin ) { |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
375 |
global $s; |
0 | 376 |
|
5 | 377 |
foreach ( $plugin as $value ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
378 |
if ( is_string( $value ) && false !== stripos( strip_tags( $value ), urldecode( $s ) ) ) { |
0 | 379 |
return true; |
5 | 380 |
} |
381 |
} |
|
0 | 382 |
|
383 |
return false; |
|
384 |
} |
|
385 |
||
5 | 386 |
/** |
387 |
* @global string $orderby |
|
388 |
* @global string $order |
|
389 |
* @param array $plugin_a |
|
390 |
* @param array $plugin_b |
|
391 |
* @return int |
|
392 |
*/ |
|
393 |
public function _order_callback( $plugin_a, $plugin_b ) { |
|
0 | 394 |
global $orderby, $order; |
395 |
||
9 | 396 |
$a = $plugin_a[ $orderby ]; |
397 |
$b = $plugin_b[ $orderby ]; |
|
0 | 398 |
|
18 | 399 |
if ( $a === $b ) { |
0 | 400 |
return 0; |
9 | 401 |
} |
0 | 402 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
403 |
if ( 'DESC' === $order ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
404 |
return strcasecmp( $b, $a ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
405 |
} else { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
406 |
return strcasecmp( $a, $b ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
407 |
} |
0 | 408 |
} |
409 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
410 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
411 |
* @global array $plugins |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
412 |
*/ |
5 | 413 |
public function no_items() { |
0 | 414 |
global $plugins; |
415 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
416 |
if ( ! empty( $_REQUEST['s'] ) ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
417 |
$s = esc_html( urldecode( wp_unslash( $_REQUEST['s'] ) ) ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
418 |
|
16 | 419 |
/* translators: %s: Plugin search term. */ |
18 | 420 |
printf( __( 'No plugins found for: %s.' ), '<strong>' . $s . '</strong>' ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
421 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
422 |
// We assume that somebody who can install plugins in multisite is experienced enough to not need this helper link. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
423 |
if ( ! is_multisite() && current_user_can( 'install_plugins' ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
424 |
echo ' <a href="' . esc_url( admin_url( 'plugin-install.php?tab=search&s=' . urlencode( $s ) ) ) . '">' . __( 'Search for plugins in the WordPress Plugin Directory.' ) . '</a>'; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
425 |
} |
9 | 426 |
} elseif ( ! empty( $plugins['all'] ) ) { |
0 | 427 |
_e( 'No plugins found.' ); |
9 | 428 |
} else { |
16 | 429 |
_e( 'No plugins are currently available.' ); |
9 | 430 |
} |
0 | 431 |
} |
432 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
433 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
434 |
* Displays the search box. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
435 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
436 |
* @since 4.6.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
437 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
438 |
* @param string $text The 'submit' button label. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
439 |
* @param string $input_id ID attribute value for the search input field. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
440 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
441 |
public function search_box( $text, $input_id ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
442 |
if ( empty( $_REQUEST['s'] ) && ! $this->has_items() ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
443 |
return; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
444 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
445 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
446 |
$input_id = $input_id . '-search-input'; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
447 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
448 |
if ( ! empty( $_REQUEST['orderby'] ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
449 |
echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '" />'; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
450 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
451 |
if ( ! empty( $_REQUEST['order'] ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
452 |
echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '" />'; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
453 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
454 |
?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
455 |
<p class="search-box"> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
456 |
<label for="<?php echo esc_attr( $input_id ); ?>"><?php echo $text; ?></label> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
457 |
<input type="search" id="<?php echo esc_attr( $input_id ); ?>" class="wp-filter-search" name="s" value="<?php _admin_search_query(); ?>" /> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
458 |
<?php submit_button( $text, 'hide-if-js', '', false, array( 'id' => 'search-submit' ) ); ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
459 |
</p> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
460 |
<?php |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
461 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
462 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
463 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
464 |
* @global string $status |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
465 |
* |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
466 |
* @return string[] Array of column titles keyed by their column name. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
467 |
*/ |
5 | 468 |
public function get_columns() { |
0 | 469 |
global $status; |
470 |
||
16 | 471 |
$columns = array( |
472 |
'cb' => ! in_array( $status, array( 'mustuse', 'dropins' ), true ) ? '<input type="checkbox" />' : '', |
|
0 | 473 |
'name' => __( 'Plugin' ), |
474 |
'description' => __( 'Description' ), |
|
475 |
); |
|
16 | 476 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
477 |
if ( $this->show_autoupdates && ! in_array( $status, array( 'mustuse', 'dropins' ), true ) ) { |
16 | 478 |
$columns['auto-updates'] = __( 'Automatic Updates' ); |
479 |
} |
|
480 |
||
481 |
return $columns; |
|
0 | 482 |
} |
483 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
484 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
485 |
* @return array |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
486 |
*/ |
5 | 487 |
protected function get_sortable_columns() { |
0 | 488 |
return array(); |
489 |
} |
|
490 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
491 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
492 |
* @global array $totals |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
493 |
* @global string $status |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
494 |
* @return array |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
495 |
*/ |
5 | 496 |
protected function get_views() { |
0 | 497 |
global $totals, $status; |
498 |
||
499 |
$status_links = array(); |
|
500 |
foreach ( $totals as $type => $count ) { |
|
9 | 501 |
if ( ! $count ) { |
0 | 502 |
continue; |
9 | 503 |
} |
0 | 504 |
|
505 |
switch ( $type ) { |
|
506 |
case 'all': |
|
16 | 507 |
/* translators: %s: Number of plugins. */ |
508 |
$text = _nx( |
|
509 |
'All <span class="count">(%s)</span>', |
|
510 |
'All <span class="count">(%s)</span>', |
|
511 |
$count, |
|
512 |
'plugins' |
|
513 |
); |
|
0 | 514 |
break; |
515 |
case 'active': |
|
16 | 516 |
/* translators: %s: Number of plugins. */ |
517 |
$text = _n( |
|
518 |
'Active <span class="count">(%s)</span>', |
|
519 |
'Active <span class="count">(%s)</span>', |
|
520 |
$count |
|
521 |
); |
|
0 | 522 |
break; |
523 |
case 'recently_activated': |
|
16 | 524 |
/* translators: %s: Number of plugins. */ |
525 |
$text = _n( |
|
526 |
'Recently Active <span class="count">(%s)</span>', |
|
527 |
'Recently Active <span class="count">(%s)</span>', |
|
528 |
$count |
|
529 |
); |
|
0 | 530 |
break; |
531 |
case 'inactive': |
|
16 | 532 |
/* translators: %s: Number of plugins. */ |
533 |
$text = _n( |
|
534 |
'Inactive <span class="count">(%s)</span>', |
|
535 |
'Inactive <span class="count">(%s)</span>', |
|
536 |
$count |
|
537 |
); |
|
0 | 538 |
break; |
539 |
case 'mustuse': |
|
16 | 540 |
/* translators: %s: Number of plugins. */ |
541 |
$text = _n( |
|
542 |
'Must-Use <span class="count">(%s)</span>', |
|
543 |
'Must-Use <span class="count">(%s)</span>', |
|
544 |
$count |
|
545 |
); |
|
0 | 546 |
break; |
547 |
case 'dropins': |
|
16 | 548 |
/* translators: %s: Number of plugins. */ |
549 |
$text = _n( |
|
550 |
'Drop-in <span class="count">(%s)</span>', |
|
551 |
'Drop-ins <span class="count">(%s)</span>', |
|
552 |
$count |
|
553 |
); |
|
9 | 554 |
break; |
555 |
case 'paused': |
|
16 | 556 |
/* translators: %s: Number of plugins. */ |
557 |
$text = _n( |
|
558 |
'Paused <span class="count">(%s)</span>', |
|
559 |
'Paused <span class="count">(%s)</span>', |
|
560 |
$count |
|
561 |
); |
|
0 | 562 |
break; |
563 |
case 'upgrade': |
|
16 | 564 |
/* translators: %s: Number of plugins. */ |
565 |
$text = _n( |
|
566 |
'Update Available <span class="count">(%s)</span>', |
|
567 |
'Update Available <span class="count">(%s)</span>', |
|
568 |
$count |
|
569 |
); |
|
570 |
break; |
|
571 |
case 'auto-update-enabled': |
|
572 |
/* translators: %s: Number of plugins. */ |
|
573 |
$text = _n( |
|
574 |
'Auto-updates Enabled <span class="count">(%s)</span>', |
|
575 |
'Auto-updates Enabled <span class="count">(%s)</span>', |
|
576 |
$count |
|
577 |
); |
|
578 |
break; |
|
579 |
case 'auto-update-disabled': |
|
580 |
/* translators: %s: Number of plugins. */ |
|
581 |
$text = _n( |
|
582 |
'Auto-updates Disabled <span class="count">(%s)</span>', |
|
583 |
'Auto-updates Disabled <span class="count">(%s)</span>', |
|
584 |
$count |
|
585 |
); |
|
0 | 586 |
break; |
587 |
} |
|
588 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
589 |
if ( 'search' !== $type ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
590 |
$status_links[ $type ] = array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
591 |
'url' => add_query_arg( 'plugin_status', $type, 'plugins.php' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
592 |
'label' => sprintf( $text, number_format_i18n( $count ) ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
593 |
'current' => $type === $status, |
9 | 594 |
); |
0 | 595 |
} |
596 |
} |
|
597 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
598 |
return $this->get_views_links( $status_links ); |
0 | 599 |
} |
600 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
601 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
602 |
* @global string $status |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
603 |
* @return array |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
604 |
*/ |
5 | 605 |
protected function get_bulk_actions() { |
0 | 606 |
global $status; |
607 |
||
608 |
$actions = array(); |
|
609 |
||
16 | 610 |
if ( 'active' !== $status ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
611 |
$actions['activate-selected'] = $this->screen->in_admin( 'network' ) ? _x( 'Network Activate', 'plugin' ) : _x( 'Activate', 'plugin' ); |
9 | 612 |
} |
0 | 613 |
|
16 | 614 |
if ( 'inactive' !== $status && 'recent' !== $status ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
615 |
$actions['deactivate-selected'] = $this->screen->in_admin( 'network' ) ? _x( 'Network Deactivate', 'plugin' ) : _x( 'Deactivate', 'plugin' ); |
9 | 616 |
} |
0 | 617 |
|
9 | 618 |
if ( ! is_multisite() || $this->screen->in_admin( 'network' ) ) { |
619 |
if ( current_user_can( 'update_plugins' ) ) { |
|
0 | 620 |
$actions['update-selected'] = __( 'Update' ); |
9 | 621 |
} |
16 | 622 |
|
623 |
if ( current_user_can( 'delete_plugins' ) && ( 'active' !== $status ) ) { |
|
0 | 624 |
$actions['delete-selected'] = __( 'Delete' ); |
9 | 625 |
} |
16 | 626 |
|
627 |
if ( $this->show_autoupdates ) { |
|
628 |
if ( 'auto-update-enabled' !== $status ) { |
|
629 |
$actions['enable-auto-update-selected'] = __( 'Enable Auto-updates' ); |
|
630 |
} |
|
631 |
if ( 'auto-update-disabled' !== $status ) { |
|
632 |
$actions['disable-auto-update-selected'] = __( 'Disable Auto-updates' ); |
|
633 |
} |
|
634 |
} |
|
0 | 635 |
} |
636 |
||
637 |
return $actions; |
|
638 |
} |
|
639 |
||
5 | 640 |
/** |
641 |
* @global string $status |
|
642 |
* @param string $which |
|
643 |
*/ |
|
644 |
public function bulk_actions( $which = '' ) { |
|
0 | 645 |
global $status; |
646 |
||
16 | 647 |
if ( in_array( $status, array( 'mustuse', 'dropins' ), true ) ) { |
0 | 648 |
return; |
9 | 649 |
} |
0 | 650 |
|
5 | 651 |
parent::bulk_actions( $which ); |
0 | 652 |
} |
653 |
||
5 | 654 |
/** |
655 |
* @global string $status |
|
656 |
* @param string $which |
|
657 |
*/ |
|
658 |
protected function extra_tablenav( $which ) { |
|
0 | 659 |
global $status; |
660 |
||
16 | 661 |
if ( ! in_array( $status, array( 'recently_activated', 'mustuse', 'dropins' ), true ) ) { |
0 | 662 |
return; |
9 | 663 |
} |
0 | 664 |
|
665 |
echo '<div class="alignleft actions">'; |
|
666 |
||
16 | 667 |
if ( 'recently_activated' === $status ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
668 |
submit_button( __( 'Clear List' ), '', 'clear-recent-list', false ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
669 |
} elseif ( 'top' === $which && 'mustuse' === $status ) { |
9 | 670 |
echo '<p>' . sprintf( |
16 | 671 |
/* translators: %s: mu-plugins directory name. */ |
9 | 672 |
__( 'Files in the %s directory are executed automatically.' ), |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
673 |
'<code>' . str_replace( ABSPATH, '/', WPMU_PLUGIN_DIR ) . '</code>' |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
674 |
) . '</p>'; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
675 |
} elseif ( 'top' === $which && 'dropins' === $status ) { |
9 | 676 |
echo '<p>' . sprintf( |
16 | 677 |
/* translators: %s: wp-content directory name. */ |
678 |
__( 'Drop-ins are single files, found in the %s directory, that replace or enhance WordPress features in ways that are not possible for traditional plugins.' ), |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
679 |
'<code>' . str_replace( ABSPATH, '', WP_CONTENT_DIR ) . '</code>' |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
680 |
) . '</p>'; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
681 |
} |
0 | 682 |
echo '</div>'; |
683 |
} |
|
684 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
685 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
686 |
* @return string |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
687 |
*/ |
5 | 688 |
public function current_action() { |
9 | 689 |
if ( isset( $_POST['clear-recent-list'] ) ) { |
0 | 690 |
return 'clear-recent-list'; |
9 | 691 |
} |
0 | 692 |
|
693 |
return parent::current_action(); |
|
694 |
} |
|
695 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
696 |
/** |
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
697 |
* Generates the list table rows. |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
698 |
* |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
699 |
* @since 3.1.0 |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
700 |
* |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
701 |
* @global string $status |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
702 |
*/ |
5 | 703 |
public function display_rows() { |
0 | 704 |
global $status; |
705 |
||
16 | 706 |
if ( is_multisite() && ! $this->screen->in_admin( 'network' ) && in_array( $status, array( 'mustuse', 'dropins' ), true ) ) { |
0 | 707 |
return; |
9 | 708 |
} |
0 | 709 |
|
9 | 710 |
foreach ( $this->items as $plugin_file => $plugin_data ) { |
0 | 711 |
$this->single_row( array( $plugin_file, $plugin_data ) ); |
9 | 712 |
} |
0 | 713 |
} |
714 |
||
5 | 715 |
/** |
716 |
* @global string $status |
|
717 |
* @global int $page |
|
718 |
* @global string $s |
|
719 |
* @global array $totals |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
720 |
* |
5 | 721 |
* @param array $item |
722 |
*/ |
|
723 |
public function single_row( $item ) { |
|
0 | 724 |
global $status, $page, $s, $totals; |
16 | 725 |
static $plugin_id_attrs = array(); |
0 | 726 |
|
727 |
list( $plugin_file, $plugin_data ) = $item; |
|
16 | 728 |
|
729 |
$plugin_slug = isset( $plugin_data['slug'] ) ? $plugin_data['slug'] : sanitize_title( $plugin_data['Name'] ); |
|
730 |
$plugin_id_attr = $plugin_slug; |
|
731 |
||
732 |
// Ensure the ID attribute is unique. |
|
733 |
$suffix = 2; |
|
734 |
while ( in_array( $plugin_id_attr, $plugin_id_attrs, true ) ) { |
|
735 |
$plugin_id_attr = "$plugin_slug-$suffix"; |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
736 |
++$suffix; |
16 | 737 |
} |
738 |
||
739 |
$plugin_id_attrs[] = $plugin_id_attr; |
|
740 |
||
741 |
$context = $status; |
|
742 |
$screen = $this->screen; |
|
0 | 743 |
|
5 | 744 |
// Pre-order. |
0 | 745 |
$actions = array( |
746 |
'deactivate' => '', |
|
9 | 747 |
'activate' => '', |
748 |
'details' => '', |
|
749 |
'delete' => '', |
|
0 | 750 |
); |
751 |
||
16 | 752 |
// Do not restrict by default. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
753 |
$restrict_network_active = false; |
9 | 754 |
$restrict_network_only = false; |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
755 |
|
19 | 756 |
$requires_php = isset( $plugin_data['RequiresPHP'] ) ? $plugin_data['RequiresPHP'] : null; |
757 |
$requires_wp = isset( $plugin_data['RequiresWP'] ) ? $plugin_data['RequiresWP'] : null; |
|
758 |
||
759 |
$compatible_php = is_php_version_compatible( $requires_php ); |
|
760 |
$compatible_wp = is_wp_version_compatible( $requires_wp ); |
|
761 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
762 |
$has_dependents = WP_Plugin_Dependencies::has_dependents( $plugin_file ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
763 |
$has_active_dependents = WP_Plugin_Dependencies::has_active_dependents( $plugin_file ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
764 |
$has_unmet_dependencies = WP_Plugin_Dependencies::has_unmet_dependencies( $plugin_file ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
765 |
$has_circular_dependency = WP_Plugin_Dependencies::has_circular_dependency( $plugin_file ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
766 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
767 |
if ( 'mustuse' === $context ) { |
0 | 768 |
$is_active = true; |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
769 |
} elseif ( 'dropins' === $context ) { |
9 | 770 |
$dropins = _get_dropins(); |
0 | 771 |
$plugin_name = $plugin_file; |
18 | 772 |
|
773 |
if ( $plugin_file !== $plugin_data['Name'] ) { |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
774 |
$plugin_name .= '<br />' . $plugin_data['Name']; |
9 | 775 |
} |
18 | 776 |
|
16 | 777 |
if ( true === ( $dropins[ $plugin_file ][1] ) ) { // Doesn't require a constant. |
9 | 778 |
$is_active = true; |
0 | 779 |
$description = '<p><strong>' . $dropins[ $plugin_file ][0] . '</strong></p>'; |
16 | 780 |
} elseif ( defined( $dropins[ $plugin_file ][1] ) && constant( $dropins[ $plugin_file ][1] ) ) { // Constant is true. |
9 | 781 |
$is_active = true; |
0 | 782 |
$description = '<p><strong>' . $dropins[ $plugin_file ][0] . '</strong></p>'; |
783 |
} else { |
|
9 | 784 |
$is_active = false; |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
785 |
$description = '<p><strong>' . $dropins[ $plugin_file ][0] . ' <span class="error-message">' . __( 'Inactive:' ) . '</span></strong> ' . |
9 | 786 |
sprintf( |
16 | 787 |
/* translators: 1: Drop-in constant name, 2: wp-config.php */ |
9 | 788 |
__( 'Requires %1$s in %2$s file.' ), |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
789 |
"<code>define('" . $dropins[ $plugin_file ][1] . "', true);</code>", |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
790 |
'<code>wp-config.php</code>' |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
791 |
) . '</p>'; |
0 | 792 |
} |
18 | 793 |
|
9 | 794 |
if ( $plugin_data['Description'] ) { |
0 | 795 |
$description .= '<p>' . $plugin_data['Description'] . '</p>'; |
9 | 796 |
} |
0 | 797 |
} else { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
798 |
if ( $screen->in_admin( 'network' ) ) { |
0 | 799 |
$is_active = is_plugin_active_for_network( $plugin_file ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
800 |
} else { |
9 | 801 |
$is_active = is_plugin_active( $plugin_file ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
802 |
$restrict_network_active = ( is_multisite() && is_plugin_active_for_network( $plugin_file ) ); |
9 | 803 |
$restrict_network_only = ( is_multisite() && is_network_only_plugin( $plugin_file ) && ! $is_active ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
804 |
} |
0 | 805 |
|
806 |
if ( $screen->in_admin( 'network' ) ) { |
|
807 |
if ( $is_active ) { |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
808 |
if ( current_user_can( 'manage_network_plugins' ) ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
809 |
if ( $has_active_dependents ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
810 |
$actions['deactivate'] = __( 'Deactivate' ) . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
811 |
'<span class="screen-reader-text">' . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
812 |
__( 'You cannot deactivate this plugin as other plugins require it.' ) . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
813 |
'</span>'; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
814 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
815 |
} else { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
816 |
$deactivate_url = 'plugins.php?action=deactivate' . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
817 |
'&plugin=' . urlencode( $plugin_file ) . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
818 |
'&plugin_status=' . $context . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
819 |
'&paged=' . $page . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
820 |
'&s=' . $s; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
821 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
822 |
$actions['deactivate'] = sprintf( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
823 |
'<a href="%s" id="deactivate-%s" aria-label="%s">%s</a>', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
824 |
wp_nonce_url( $deactivate_url, 'deactivate-plugin_' . $plugin_file ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
825 |
esc_attr( $plugin_id_attr ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
826 |
/* translators: %s: Plugin name. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
827 |
esc_attr( sprintf( _x( 'Network Deactivate %s', 'plugin' ), $plugin_data['Name'] ) ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
828 |
_x( 'Network Deactivate', 'plugin' ) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
829 |
); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
830 |
} |
9 | 831 |
} |
0 | 832 |
} else { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
833 |
if ( current_user_can( 'manage_network_plugins' ) ) { |
19 | 834 |
if ( $compatible_php && $compatible_wp ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
835 |
if ( $has_unmet_dependencies ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
836 |
$actions['activate'] = _x( 'Network Activate', 'plugin' ) . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
837 |
'<span class="screen-reader-text">' . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
838 |
__( 'You cannot activate this plugin as it has unmet requirements.' ) . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
839 |
'</span>'; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
840 |
} else { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
841 |
$activate_url = 'plugins.php?action=activate' . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
842 |
'&plugin=' . urlencode( $plugin_file ) . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
843 |
'&plugin_status=' . $context . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
844 |
'&paged=' . $page . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
845 |
'&s=' . $s; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
846 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
847 |
$actions['activate'] = sprintf( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
848 |
'<a href="%s" id="activate-%s" class="edit" aria-label="%s">%s</a>', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
849 |
wp_nonce_url( $activate_url, 'activate-plugin_' . $plugin_file ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
850 |
esc_attr( $plugin_id_attr ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
851 |
/* translators: %s: Plugin name. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
852 |
esc_attr( sprintf( _x( 'Network Activate %s', 'plugin' ), $plugin_data['Name'] ) ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
853 |
_x( 'Network Activate', 'plugin' ) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
854 |
); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
855 |
} |
19 | 856 |
} else { |
857 |
$actions['activate'] = sprintf( |
|
858 |
'<span>%s</span>', |
|
859 |
_x( 'Cannot Activate', 'plugin' ) |
|
860 |
); |
|
861 |
} |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
862 |
} |
16 | 863 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
864 |
if ( current_user_can( 'delete_plugins' ) && ! is_plugin_active( $plugin_file ) ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
865 |
if ( $has_dependents && ! $has_circular_dependency ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
866 |
$actions['delete'] = __( 'Delete' ) . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
867 |
'<span class="screen-reader-text">' . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
868 |
__( 'You cannot delete this plugin as other plugins require it.' ) . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
869 |
'</span>'; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
870 |
} else { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
871 |
$delete_url = 'plugins.php?action=delete-selected' . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
872 |
'&checked[]=' . urlencode( $plugin_file ) . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
873 |
'&plugin_status=' . $context . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
874 |
'&paged=' . $page . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
875 |
'&s=' . $s; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
876 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
877 |
$actions['delete'] = sprintf( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
878 |
'<a href="%s" id="delete-%s" class="delete" aria-label="%s">%s</a>', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
879 |
wp_nonce_url( $delete_url, 'bulk-plugins' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
880 |
esc_attr( $plugin_id_attr ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
881 |
/* translators: %s: Plugin name. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
882 |
esc_attr( sprintf( _x( 'Delete %s', 'plugin' ), $plugin_data['Name'] ) ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
883 |
__( 'Delete' ) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
884 |
); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
885 |
} |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
886 |
} |
0 | 887 |
} |
888 |
} else { |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
889 |
if ( $restrict_network_active ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
890 |
$actions = array( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
891 |
'network_active' => __( 'Network Active' ), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
892 |
); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
893 |
} elseif ( $restrict_network_only ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
894 |
$actions = array( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
895 |
'network_only' => __( 'Network Only' ), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
896 |
); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
897 |
} elseif ( $is_active ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
898 |
if ( current_user_can( 'deactivate_plugin', $plugin_file ) ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
899 |
if ( $has_active_dependents ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
900 |
$actions['deactivate'] = __( 'Deactivate' ) . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
901 |
'<span class="screen-reader-text">' . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
902 |
__( 'You cannot deactivate this plugin as other plugins depend on it.' ) . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
903 |
'</span>'; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
904 |
} else { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
905 |
$deactivate_url = 'plugins.php?action=deactivate' . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
906 |
'&plugin=' . urlencode( $plugin_file ) . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
907 |
'&plugin_status=' . $context . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
908 |
'&paged=' . $page . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
909 |
'&s=' . $s; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
910 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
911 |
$actions['deactivate'] = sprintf( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
912 |
'<a href="%s" id="deactivate-%s" aria-label="%s">%s</a>', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
913 |
wp_nonce_url( $deactivate_url, 'deactivate-plugin_' . $plugin_file ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
914 |
esc_attr( $plugin_id_attr ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
915 |
/* translators: %s: Plugin name. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
916 |
esc_attr( sprintf( _x( 'Deactivate %s', 'plugin' ), $plugin_data['Name'] ) ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
917 |
__( 'Deactivate' ) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
918 |
); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
919 |
} |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
920 |
} |
16 | 921 |
|
9 | 922 |
if ( current_user_can( 'resume_plugin', $plugin_file ) && is_plugin_paused( $plugin_file ) ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
923 |
$resume_url = 'plugins.php?action=resume' . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
924 |
'&plugin=' . urlencode( $plugin_file ) . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
925 |
'&plugin_status=' . $context . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
926 |
'&paged=' . $page . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
927 |
'&s=' . $s; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
928 |
|
16 | 929 |
$actions['resume'] = sprintf( |
930 |
'<a href="%s" id="resume-%s" class="resume-link" aria-label="%s">%s</a>', |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
931 |
wp_nonce_url( $resume_url, 'resume-plugin_' . $plugin_file ), |
16 | 932 |
esc_attr( $plugin_id_attr ), |
933 |
/* translators: %s: Plugin name. */ |
|
934 |
esc_attr( sprintf( _x( 'Resume %s', 'plugin' ), $plugin_data['Name'] ) ), |
|
935 |
__( 'Resume' ) |
|
936 |
); |
|
9 | 937 |
} |
0 | 938 |
} else { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
939 |
if ( current_user_can( 'activate_plugin', $plugin_file ) ) { |
19 | 940 |
if ( $compatible_php && $compatible_wp ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
941 |
if ( $has_unmet_dependencies ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
942 |
$actions['activate'] = _x( 'Activate', 'plugin' ) . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
943 |
'<span class="screen-reader-text">' . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
944 |
__( 'You cannot activate this plugin as it has unmet requirements.' ) . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
945 |
'</span>'; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
946 |
} else { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
947 |
$activate_url = 'plugins.php?action=activate' . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
948 |
'&plugin=' . urlencode( $plugin_file ) . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
949 |
'&plugin_status=' . $context . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
950 |
'&paged=' . $page . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
951 |
'&s=' . $s; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
952 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
953 |
$actions['activate'] = sprintf( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
954 |
'<a href="%s" id="activate-%s" class="edit" aria-label="%s">%s</a>', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
955 |
wp_nonce_url( $activate_url, 'activate-plugin_' . $plugin_file ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
956 |
esc_attr( $plugin_id_attr ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
957 |
/* translators: %s: Plugin name. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
958 |
esc_attr( sprintf( _x( 'Activate %s', 'plugin' ), $plugin_data['Name'] ) ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
959 |
_x( 'Activate', 'plugin' ) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
960 |
); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
961 |
} |
19 | 962 |
} else { |
963 |
$actions['activate'] = sprintf( |
|
964 |
'<span>%s</span>', |
|
965 |
_x( 'Cannot Activate', 'plugin' ) |
|
966 |
); |
|
967 |
} |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
968 |
} |
0 | 969 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
970 |
if ( ! is_multisite() && current_user_can( 'delete_plugins' ) ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
971 |
if ( $has_dependents && ! $has_circular_dependency ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
972 |
$actions['delete'] = __( 'Delete' ) . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
973 |
'<span class="screen-reader-text">' . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
974 |
__( 'You cannot delete this plugin as other plugins require it.' ) . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
975 |
'</span>'; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
976 |
} else { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
977 |
$delete_url = 'plugins.php?action=delete-selected' . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
978 |
'&checked[]=' . urlencode( $plugin_file ) . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
979 |
'&plugin_status=' . $context . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
980 |
'&paged=' . $page . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
981 |
'&s=' . $s; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
982 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
983 |
$actions['delete'] = sprintf( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
984 |
'<a href="%s" id="delete-%s" class="delete" aria-label="%s">%s</a>', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
985 |
wp_nonce_url( $delete_url, 'bulk-plugins' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
986 |
esc_attr( $plugin_id_attr ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
987 |
/* translators: %s: Plugin name. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
988 |
esc_attr( sprintf( _x( 'Delete %s', 'plugin' ), $plugin_data['Name'] ) ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
989 |
__( 'Delete' ) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
990 |
); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
991 |
} |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
992 |
} |
16 | 993 |
} // End if $is_active. |
994 |
} // End if $screen->in_admin( 'network' ). |
|
995 |
} // End if $context. |
|
0 | 996 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
997 |
$actions = array_filter( $actions ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
998 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
999 |
if ( $screen->in_admin( 'network' ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1000 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1001 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1002 |
* Filters the action links displayed for each plugin in the Network Admin Plugins list table. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1003 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1004 |
* @since 3.1.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1005 |
* |
19 | 1006 |
* @param string[] $actions An array of plugin action links. By default this can include |
1007 |
* 'activate', 'deactivate', and 'delete'. |
|
9 | 1008 |
* @param string $plugin_file Path to the plugin file relative to the plugins directory. |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1009 |
* @param array $plugin_data An array of plugin data. See get_plugin_data() |
19 | 1010 |
* and the {@see 'plugin_row_meta'} filter for the list |
1011 |
* of possible values. |
|
1012 |
* @param string $context The plugin context. By default this can include 'all', |
|
1013 |
* 'active', 'inactive', 'recently_activated', 'upgrade', |
|
1014 |
* 'mustuse', 'dropins', and 'search'. |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1015 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1016 |
$actions = apply_filters( 'network_admin_plugin_action_links', $actions, $plugin_file, $plugin_data, $context ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1017 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1018 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1019 |
* Filters the list of action links displayed for a specific plugin in the Network Admin Plugins list table. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1020 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1021 |
* The dynamic portion of the hook name, `$plugin_file`, refers to the path |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1022 |
* to the plugin file, relative to the plugins directory. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1023 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1024 |
* @since 3.1.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1025 |
* |
19 | 1026 |
* @param string[] $actions An array of plugin action links. By default this can include |
1027 |
* 'activate', 'deactivate', and 'delete'. |
|
9 | 1028 |
* @param string $plugin_file Path to the plugin file relative to the plugins directory. |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1029 |
* @param array $plugin_data An array of plugin data. See get_plugin_data() |
19 | 1030 |
* and the {@see 'plugin_row_meta'} filter for the list |
1031 |
* of possible values. |
|
1032 |
* @param string $context The plugin context. By default this can include 'all', |
|
1033 |
* 'active', 'inactive', 'recently_activated', 'upgrade', |
|
1034 |
* 'mustuse', 'dropins', and 'search'. |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1035 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1036 |
$actions = apply_filters( "network_admin_plugin_action_links_{$plugin_file}", $actions, $plugin_file, $plugin_data, $context ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1037 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1038 |
} else { |
5 | 1039 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1040 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1041 |
* Filters the action links displayed for each plugin in the Plugins list table. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1042 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1043 |
* @since 2.5.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1044 |
* @since 2.6.0 The `$context` parameter was added. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1045 |
* @since 4.9.0 The 'Edit' link was removed from the list of action links. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1046 |
* |
19 | 1047 |
* @param string[] $actions An array of plugin action links. By default this can include |
1048 |
* 'activate', 'deactivate', and 'delete'. With Multisite active |
|
1049 |
* this can also include 'network_active' and 'network_only' items. |
|
9 | 1050 |
* @param string $plugin_file Path to the plugin file relative to the plugins directory. |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1051 |
* @param array $plugin_data An array of plugin data. See get_plugin_data() |
19 | 1052 |
* and the {@see 'plugin_row_meta'} filter for the list |
1053 |
* of possible values. |
|
1054 |
* @param string $context The plugin context. By default this can include 'all', |
|
1055 |
* 'active', 'inactive', 'recently_activated', 'upgrade', |
|
1056 |
* 'mustuse', 'dropins', and 'search'. |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1057 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1058 |
$actions = apply_filters( 'plugin_action_links', $actions, $plugin_file, $plugin_data, $context ); |
5 | 1059 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1060 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1061 |
* Filters the list of action links displayed for a specific plugin in the Plugins list table. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1062 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1063 |
* The dynamic portion of the hook name, `$plugin_file`, refers to the path |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1064 |
* to the plugin file, relative to the plugins directory. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1065 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1066 |
* @since 2.7.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1067 |
* @since 4.9.0 The 'Edit' link was removed from the list of action links. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1068 |
* |
19 | 1069 |
* @param string[] $actions An array of plugin action links. By default this can include |
1070 |
* 'activate', 'deactivate', and 'delete'. With Multisite active |
|
1071 |
* this can also include 'network_active' and 'network_only' items. |
|
9 | 1072 |
* @param string $plugin_file Path to the plugin file relative to the plugins directory. |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1073 |
* @param array $plugin_data An array of plugin data. See get_plugin_data() |
19 | 1074 |
* and the {@see 'plugin_row_meta'} filter for the list |
1075 |
* of possible values. |
|
1076 |
* @param string $context The plugin context. By default this can include 'all', |
|
1077 |
* 'active', 'inactive', 'recently_activated', 'upgrade', |
|
1078 |
* 'mustuse', 'dropins', and 'search'. |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1079 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1080 |
$actions = apply_filters( "plugin_action_links_{$plugin_file}", $actions, $plugin_file, $plugin_data, $context ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1081 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1082 |
} |
0 | 1083 |
|
19 | 1084 |
$class = $is_active ? 'active' : 'inactive'; |
1085 |
$checkbox_id = 'checkbox_' . md5( $plugin_file ); |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1086 |
$disabled = ''; |
18 | 1087 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1088 |
if ( $has_dependents || $has_unmet_dependencies ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1089 |
$disabled = 'disabled'; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1090 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1091 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1092 |
if ( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1093 |
$restrict_network_active || |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1094 |
$restrict_network_only || |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1095 |
in_array( $status, array( 'mustuse', 'dropins' ), true ) || |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1096 |
! $compatible_php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1097 |
) { |
0 | 1098 |
$checkbox = ''; |
1099 |
} else { |
|
16 | 1100 |
$checkbox = sprintf( |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1101 |
'<label class="label-covers-full-cell" for="%1$s">' . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1102 |
'<span class="screen-reader-text">%2$s</span></label>' . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1103 |
'<input type="checkbox" name="checked[]" value="%3$s" id="%1$s" ' . $disabled . '/>', |
16 | 1104 |
$checkbox_id, |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1105 |
/* translators: Hidden accessibility text. %s: Plugin name. */ |
16 | 1106 |
sprintf( __( 'Select %s' ), $plugin_data['Name'] ), |
1107 |
esc_attr( $plugin_file ) |
|
1108 |
); |
|
0 | 1109 |
} |
18 | 1110 |
|
16 | 1111 |
if ( 'dropins' !== $context ) { |
0 | 1112 |
$description = '<p>' . ( $plugin_data['Description'] ? $plugin_data['Description'] : ' ' ) . '</p>'; |
1113 |
$plugin_name = $plugin_data['Name']; |
|
1114 |
} |
|
1115 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1116 |
if ( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1117 |
! empty( $totals['upgrade'] ) && |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1118 |
! empty( $plugin_data['update'] ) || |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1119 |
! $compatible_php || |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1120 |
! $compatible_wp |
19 | 1121 |
) { |
0 | 1122 |
$class .= ' update'; |
9 | 1123 |
} |
1124 |
||
1125 |
$paused = ! $screen->in_admin( 'network' ) && is_plugin_paused( $plugin_file ); |
|
1126 |
||
1127 |
if ( $paused ) { |
|
1128 |
$class .= ' paused'; |
|
1129 |
} |
|
0 | 1130 |
|
16 | 1131 |
if ( is_uninstallable_plugin( $plugin_file ) ) { |
1132 |
$class .= ' is-uninstallable'; |
|
1133 |
} |
|
1134 |
||
9 | 1135 |
printf( |
1136 |
'<tr class="%s" data-slug="%s" data-plugin="%s">', |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1137 |
esc_attr( $class ), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1138 |
esc_attr( $plugin_slug ), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1139 |
esc_attr( $plugin_file ) |
5 | 1140 |
); |
0 | 1141 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1142 |
list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info(); |
0 | 1143 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1144 |
$auto_updates = (array) get_site_option( 'auto_update_plugins', array() ); |
16 | 1145 |
|
0 | 1146 |
foreach ( $columns as $column_name => $column_display_name ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1147 |
$extra_classes = ''; |
16 | 1148 |
if ( in_array( $column_name, $hidden, true ) ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1149 |
$extra_classes = ' hidden'; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1150 |
} |
0 | 1151 |
|
1152 |
switch ( $column_name ) { |
|
1153 |
case 'cb': |
|
1154 |
echo "<th scope='row' class='check-column'>$checkbox</th>"; |
|
1155 |
break; |
|
1156 |
case 'name': |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1157 |
echo "<td class='plugin-title column-primary'><strong>$plugin_name</strong>"; |
0 | 1158 |
echo $this->row_actions( $actions, true ); |
9 | 1159 |
echo '</td>'; |
0 | 1160 |
break; |
1161 |
case 'description': |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1162 |
$classes = 'column-description desc'; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1163 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1164 |
echo "<td class='$classes{$extra_classes}'> |
0 | 1165 |
<div class='plugin-description'>$description</div> |
1166 |
<div class='$class second plugin-version-author-uri'>"; |
|
1167 |
||
1168 |
$plugin_meta = array(); |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1169 |
|
9 | 1170 |
if ( ! empty( $plugin_data['Version'] ) ) { |
16 | 1171 |
/* translators: %s: Plugin version number. */ |
0 | 1172 |
$plugin_meta[] = sprintf( __( 'Version %s' ), $plugin_data['Version'] ); |
9 | 1173 |
} |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1174 |
|
9 | 1175 |
if ( ! empty( $plugin_data['Author'] ) ) { |
0 | 1176 |
$author = $plugin_data['Author']; |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1177 |
|
9 | 1178 |
if ( ! empty( $plugin_data['AuthorURI'] ) ) { |
5 | 1179 |
$author = '<a href="' . $plugin_data['AuthorURI'] . '">' . $plugin_data['Author'] . '</a>'; |
9 | 1180 |
} |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1181 |
|
16 | 1182 |
/* translators: %s: Plugin author name. */ |
0 | 1183 |
$plugin_meta[] = sprintf( __( 'By %s' ), $author ); |
1184 |
} |
|
1185 |
||
16 | 1186 |
// Details link using API info, if available. |
5 | 1187 |
if ( isset( $plugin_data['slug'] ) && current_user_can( 'install_plugins' ) ) { |
9 | 1188 |
$plugin_meta[] = sprintf( |
1189 |
'<a href="%s" class="thickbox open-plugin-details-modal" aria-label="%s" data-title="%s">%s</a>', |
|
1190 |
esc_url( |
|
1191 |
network_admin_url( |
|
1192 |
'plugin-install.php?tab=plugin-information&plugin=' . $plugin_data['slug'] . |
|
1193 |
'&TB_iframe=true&width=600&height=550' |
|
1194 |
) |
|
1195 |
), |
|
16 | 1196 |
/* translators: %s: Plugin name. */ |
5 | 1197 |
esc_attr( sprintf( __( 'More information about %s' ), $plugin_name ) ), |
1198 |
esc_attr( $plugin_name ), |
|
1199 |
__( 'View details' ) |
|
1200 |
); |
|
1201 |
} elseif ( ! empty( $plugin_data['PluginURI'] ) ) { |
|
19 | 1202 |
/* translators: %s: Plugin name. */ |
1203 |
$aria_label = sprintf( __( 'Visit plugin site for %s' ), $plugin_name ); |
|
1204 |
||
9 | 1205 |
$plugin_meta[] = sprintf( |
19 | 1206 |
'<a href="%s" aria-label="%s">%s</a>', |
5 | 1207 |
esc_url( $plugin_data['PluginURI'] ), |
19 | 1208 |
esc_attr( $aria_label ), |
5 | 1209 |
__( 'Visit plugin site' ) |
1210 |
); |
|
1211 |
} |
|
1212 |
||
1213 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1214 |
* Filters the array of row meta for each plugin in the Plugins list table. |
5 | 1215 |
* |
1216 |
* @since 2.8.0 |
|
1217 |
* |
|
16 | 1218 |
* @param string[] $plugin_meta An array of the plugin's metadata, including |
1219 |
* the version, author, author URI, and plugin URI. |
|
9 | 1220 |
* @param string $plugin_file Path to the plugin file relative to the plugins directory. |
19 | 1221 |
* @param array $plugin_data { |
1222 |
* An array of plugin data. |
|
1223 |
* |
|
1224 |
* @type string $id Plugin ID, e.g. `w.org/plugins/[plugin-name]`. |
|
1225 |
* @type string $slug Plugin slug. |
|
1226 |
* @type string $plugin Plugin basename. |
|
1227 |
* @type string $new_version New plugin version. |
|
1228 |
* @type string $url Plugin URL. |
|
1229 |
* @type string $package Plugin update package URL. |
|
1230 |
* @type string[] $icons An array of plugin icon URLs. |
|
1231 |
* @type string[] $banners An array of plugin banner URLs. |
|
1232 |
* @type string[] $banners_rtl An array of plugin RTL banner URLs. |
|
1233 |
* @type string $requires The version of WordPress which the plugin requires. |
|
1234 |
* @type string $tested The version of WordPress the plugin is tested against. |
|
1235 |
* @type string $requires_php The version of PHP which the plugin requires. |
|
1236 |
* @type string $upgrade_notice The upgrade notice for the new plugin version. |
|
1237 |
* @type bool $update-supported Whether the plugin supports updates. |
|
1238 |
* @type string $Name The human-readable name of the plugin. |
|
1239 |
* @type string $PluginURI Plugin URI. |
|
1240 |
* @type string $Version Plugin version. |
|
1241 |
* @type string $Description Plugin description. |
|
1242 |
* @type string $Author Plugin author. |
|
1243 |
* @type string $AuthorURI Plugin author URI. |
|
1244 |
* @type string $TextDomain Plugin textdomain. |
|
1245 |
* @type string $DomainPath Relative path to the plugin's .mo file(s). |
|
1246 |
* @type bool $Network Whether the plugin can only be activated network-wide. |
|
1247 |
* @type string $RequiresWP The version of WordPress which the plugin requires. |
|
1248 |
* @type string $RequiresPHP The version of PHP which the plugin requires. |
|
1249 |
* @type string $UpdateURI ID of the plugin for update purposes, should be a URI. |
|
1250 |
* @type string $Title The human-readable title of the plugin. |
|
1251 |
* @type string $AuthorName Plugin author's name. |
|
1252 |
* @type bool $update Whether there's an available update. Default null. |
|
1253 |
* } |
|
16 | 1254 |
* @param string $status Status filter currently applied to the plugin list. Possible |
1255 |
* values are: 'all', 'active', 'inactive', 'recently_activated', |
|
1256 |
* 'upgrade', 'mustuse', 'dropins', 'search', 'paused', |
|
1257 |
* 'auto-update-enabled', 'auto-update-disabled'. |
|
5 | 1258 |
*/ |
0 | 1259 |
$plugin_meta = apply_filters( 'plugin_row_meta', $plugin_meta, $plugin_file, $plugin_data, $status ); |
16 | 1260 |
|
0 | 1261 |
echo implode( ' | ', $plugin_meta ); |
1262 |
||
9 | 1263 |
echo '</div>'; |
1264 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1265 |
if ( $has_dependents ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1266 |
$this->add_dependents_to_dependency_plugin_row( $plugin_file ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1267 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1268 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1269 |
if ( WP_Plugin_Dependencies::has_dependencies( $plugin_file ) ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1270 |
$this->add_dependencies_to_dependent_plugin_row( $plugin_file ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1271 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1272 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1273 |
/** |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1274 |
* Fires after plugin row meta. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1275 |
* |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1276 |
* @since 6.5.0 |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1277 |
* |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1278 |
* @param string $plugin_file Refer to {@see 'plugin_row_meta'} filter. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1279 |
* @param array $plugin_data Refer to {@see 'plugin_row_meta'} filter. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1280 |
*/ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1281 |
do_action( 'after_plugin_row_meta', $plugin_file, $plugin_data ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1282 |
|
9 | 1283 |
if ( $paused ) { |
1284 |
$notice_text = __( 'This plugin failed to load properly and is paused during recovery mode.' ); |
|
1285 |
||
1286 |
printf( '<p><span class="dashicons dashicons-warning"></span> <strong>%s</strong></p>', $notice_text ); |
|
1287 |
||
1288 |
$error = wp_get_plugin_error( $plugin_file ); |
|
1289 |
||
1290 |
if ( false !== $error ) { |
|
1291 |
printf( '<div class="error-display"><p>%s</p></div>', wp_get_extension_error_description( $error ) ); |
|
1292 |
} |
|
1293 |
} |
|
1294 |
||
1295 |
echo '</td>'; |
|
0 | 1296 |
break; |
16 | 1297 |
case 'auto-updates': |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1298 |
if ( ! $this->show_autoupdates || in_array( $status, array( 'mustuse', 'dropins' ), true ) ) { |
16 | 1299 |
break; |
1300 |
} |
|
1301 |
||
1302 |
echo "<td class='column-auto-updates{$extra_classes}'>"; |
|
1303 |
||
1304 |
$html = array(); |
|
1305 |
||
1306 |
if ( isset( $plugin_data['auto-update-forced'] ) ) { |
|
1307 |
if ( $plugin_data['auto-update-forced'] ) { |
|
1308 |
// Forced on. |
|
1309 |
$text = __( 'Auto-updates enabled' ); |
|
1310 |
} else { |
|
1311 |
$text = __( 'Auto-updates disabled' ); |
|
1312 |
} |
|
1313 |
$action = 'unavailable'; |
|
1314 |
$time_class = ' hidden'; |
|
1315 |
} elseif ( empty( $plugin_data['update-supported'] ) ) { |
|
1316 |
$text = ''; |
|
1317 |
$action = 'unavailable'; |
|
1318 |
$time_class = ' hidden'; |
|
1319 |
} elseif ( in_array( $plugin_file, $auto_updates, true ) ) { |
|
1320 |
$text = __( 'Disable auto-updates' ); |
|
1321 |
$action = 'disable'; |
|
1322 |
$time_class = ''; |
|
1323 |
} else { |
|
1324 |
$text = __( 'Enable auto-updates' ); |
|
1325 |
$action = 'enable'; |
|
1326 |
$time_class = ' hidden'; |
|
1327 |
} |
|
1328 |
||
1329 |
$query_args = array( |
|
1330 |
'action' => "{$action}-auto-update", |
|
1331 |
'plugin' => $plugin_file, |
|
1332 |
'paged' => $page, |
|
1333 |
'plugin_status' => $status, |
|
1334 |
); |
|
1335 |
||
1336 |
$url = add_query_arg( $query_args, 'plugins.php' ); |
|
1337 |
||
18 | 1338 |
if ( 'unavailable' === $action ) { |
16 | 1339 |
$html[] = '<span class="label">' . $text . '</span>'; |
1340 |
} else { |
|
1341 |
$html[] = sprintf( |
|
1342 |
'<a href="%s" class="toggle-auto-update aria-button-if-js" data-wp-action="%s">', |
|
1343 |
wp_nonce_url( $url, 'updates' ), |
|
1344 |
$action |
|
1345 |
); |
|
1346 |
||
1347 |
$html[] = '<span class="dashicons dashicons-update spin hidden" aria-hidden="true"></span>'; |
|
1348 |
$html[] = '<span class="label">' . $text . '</span>'; |
|
1349 |
$html[] = '</a>'; |
|
1350 |
} |
|
1351 |
||
1352 |
if ( ! empty( $plugin_data['update'] ) ) { |
|
1353 |
$html[] = sprintf( |
|
1354 |
'<div class="auto-update-time%s">%s</div>', |
|
1355 |
$time_class, |
|
1356 |
wp_get_auto_update_message() |
|
1357 |
); |
|
1358 |
} |
|
1359 |
||
1360 |
$html = implode( '', $html ); |
|
1361 |
||
1362 |
/** |
|
1363 |
* Filters the HTML of the auto-updates setting for each plugin in the Plugins list table. |
|
1364 |
* |
|
1365 |
* @since 5.5.0 |
|
1366 |
* |
|
19 | 1367 |
* @param string $html The HTML of the plugin's auto-update column content, |
1368 |
* including toggle auto-update action links and |
|
1369 |
* time to next update. |
|
16 | 1370 |
* @param string $plugin_file Path to the plugin file relative to the plugins directory. |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1371 |
* @param array $plugin_data An array of plugin data. See get_plugin_data() |
19 | 1372 |
* and the {@see 'plugin_row_meta'} filter for the list |
1373 |
* of possible values. |
|
16 | 1374 |
*/ |
1375 |
echo apply_filters( 'plugin_auto_update_setting_html', $html, $plugin_file, $plugin_data ); |
|
1376 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1377 |
wp_admin_notice( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1378 |
'', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1379 |
array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1380 |
'type' => 'error', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1381 |
'additional_classes' => array( 'notice-alt', 'inline', 'hidden' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1382 |
) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1383 |
); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1384 |
|
16 | 1385 |
echo '</td>'; |
1386 |
||
1387 |
break; |
|
0 | 1388 |
default: |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1389 |
$classes = "$column_name column-$column_name $class"; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1390 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1391 |
echo "<td class='$classes{$extra_classes}'>"; |
5 | 1392 |
|
1393 |
/** |
|
1394 |
* Fires inside each custom column of the Plugins list table. |
|
1395 |
* |
|
1396 |
* @since 3.1.0 |
|
1397 |
* |
|
1398 |
* @param string $column_name Name of the column. |
|
9 | 1399 |
* @param string $plugin_file Path to the plugin file relative to the plugins directory. |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1400 |
* @param array $plugin_data An array of plugin data. See get_plugin_data() |
19 | 1401 |
* and the {@see 'plugin_row_meta'} filter for the list |
1402 |
* of possible values. |
|
5 | 1403 |
*/ |
0 | 1404 |
do_action( 'manage_plugins_custom_column', $column_name, $plugin_file, $plugin_data ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1405 |
|
9 | 1406 |
echo '</td>'; |
0 | 1407 |
} |
1408 |
} |
|
1409 |
||
9 | 1410 |
echo '</tr>'; |
0 | 1411 |
|
19 | 1412 |
if ( ! $compatible_php || ! $compatible_wp ) { |
1413 |
printf( |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1414 |
'<tr class="plugin-update-tr"><td colspan="%s" class="plugin-update colspanchange">', |
19 | 1415 |
esc_attr( $this->get_column_count() ) |
1416 |
); |
|
1417 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1418 |
$incompatible_message = ''; |
19 | 1419 |
if ( ! $compatible_php && ! $compatible_wp ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1420 |
$incompatible_message .= __( 'This plugin does not work with your versions of WordPress and PHP.' ); |
19 | 1421 |
if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1422 |
$incompatible_message .= sprintf( |
19 | 1423 |
/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */ |
1424 |
' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ), |
|
1425 |
self_admin_url( 'update-core.php' ), |
|
1426 |
esc_url( wp_get_update_php_url() ) |
|
1427 |
); |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1428 |
$incompatible_message .= wp_update_php_annotation( '</p><p><em>', '</em>', false ); |
19 | 1429 |
} elseif ( current_user_can( 'update_core' ) ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1430 |
$incompatible_message .= sprintf( |
19 | 1431 |
/* translators: %s: URL to WordPress Updates screen. */ |
1432 |
' ' . __( '<a href="%s">Please update WordPress</a>.' ), |
|
1433 |
self_admin_url( 'update-core.php' ) |
|
1434 |
); |
|
1435 |
} elseif ( current_user_can( 'update_php' ) ) { |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1436 |
$incompatible_message .= sprintf( |
19 | 1437 |
/* translators: %s: URL to Update PHP page. */ |
1438 |
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ), |
|
1439 |
esc_url( wp_get_update_php_url() ) |
|
1440 |
); |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1441 |
$incompatible_message .= wp_update_php_annotation( '</p><p><em>', '</em>', false ); |
19 | 1442 |
} |
1443 |
} elseif ( ! $compatible_wp ) { |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1444 |
$incompatible_message .= __( 'This plugin does not work with your version of WordPress.' ); |
19 | 1445 |
if ( current_user_can( 'update_core' ) ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1446 |
$incompatible_message .= sprintf( |
19 | 1447 |
/* translators: %s: URL to WordPress Updates screen. */ |
1448 |
' ' . __( '<a href="%s">Please update WordPress</a>.' ), |
|
1449 |
self_admin_url( 'update-core.php' ) |
|
1450 |
); |
|
1451 |
} |
|
1452 |
} elseif ( ! $compatible_php ) { |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1453 |
$incompatible_message .= __( 'This plugin does not work with your version of PHP.' ); |
19 | 1454 |
if ( current_user_can( 'update_php' ) ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1455 |
$incompatible_message .= sprintf( |
19 | 1456 |
/* translators: %s: URL to Update PHP page. */ |
1457 |
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ), |
|
1458 |
esc_url( wp_get_update_php_url() ) |
|
1459 |
); |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1460 |
$incompatible_message .= wp_update_php_annotation( '</p><p><em>', '</em>', false ); |
19 | 1461 |
} |
1462 |
} |
|
1463 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1464 |
wp_admin_notice( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1465 |
$incompatible_message, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1466 |
array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1467 |
'type' => 'error', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1468 |
'additional_classes' => array( 'notice-alt', 'inline', 'update-message' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1469 |
) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1470 |
); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1471 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1472 |
echo '</td></tr>'; |
19 | 1473 |
} |
1474 |
||
5 | 1475 |
/** |
1476 |
* Fires after each row in the Plugins list table. |
|
1477 |
* |
|
1478 |
* @since 2.3.0 |
|
19 | 1479 |
* @since 5.5.0 Added 'auto-update-enabled' and 'auto-update-disabled' |
1480 |
* to possible values for `$status`. |
|
5 | 1481 |
* |
9 | 1482 |
* @param string $plugin_file Path to the plugin file relative to the plugins directory. |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1483 |
* @param array $plugin_data An array of plugin data. See get_plugin_data() |
19 | 1484 |
* and the {@see 'plugin_row_meta'} filter for the list |
1485 |
* of possible values. |
|
1486 |
* @param string $status Status filter currently applied to the plugin list. |
|
1487 |
* Possible values are: 'all', 'active', 'inactive', |
|
1488 |
* 'recently_activated', 'upgrade', 'mustuse', 'dropins', |
|
1489 |
* 'search', 'paused', 'auto-update-enabled', 'auto-update-disabled'. |
|
5 | 1490 |
*/ |
0 | 1491 |
do_action( 'after_plugin_row', $plugin_file, $plugin_data, $status ); |
5 | 1492 |
|
1493 |
/** |
|
1494 |
* Fires after each specific row in the Plugins list table. |
|
1495 |
* |
|
1496 |
* The dynamic portion of the hook name, `$plugin_file`, refers to the path |
|
1497 |
* to the plugin file, relative to the plugins directory. |
|
1498 |
* |
|
1499 |
* @since 2.7.0 |
|
19 | 1500 |
* @since 5.5.0 Added 'auto-update-enabled' and 'auto-update-disabled' |
1501 |
* to possible values for `$status`. |
|
5 | 1502 |
* |
9 | 1503 |
* @param string $plugin_file Path to the plugin file relative to the plugins directory. |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1504 |
* @param array $plugin_data An array of plugin data. See get_plugin_data() |
19 | 1505 |
* and the {@see 'plugin_row_meta'} filter for the list |
1506 |
* of possible values. |
|
1507 |
* @param string $status Status filter currently applied to the plugin list. |
|
1508 |
* Possible values are: 'all', 'active', 'inactive', |
|
1509 |
* 'recently_activated', 'upgrade', 'mustuse', 'dropins', |
|
1510 |
* 'search', 'paused', 'auto-update-enabled', 'auto-update-disabled'. |
|
5 | 1511 |
*/ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1512 |
do_action( "after_plugin_row_{$plugin_file}", $plugin_file, $plugin_data, $status ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1513 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1514 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1515 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1516 |
* Gets the name of the primary column for this specific list table. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1517 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1518 |
* @since 4.3.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1519 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1520 |
* @return string Unalterable name for the primary column, in this case, 'name'. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1521 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1522 |
protected function get_primary_column_name() { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1523 |
return 'name'; |
0 | 1524 |
} |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1525 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1526 |
/** |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1527 |
* Prints a list of other plugins that depend on the plugin. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1528 |
* |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1529 |
* @since 6.5.0 |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1530 |
* |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1531 |
* @param string $dependency The dependency's filepath, relative to the plugins directory. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1532 |
*/ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1533 |
protected function add_dependents_to_dependency_plugin_row( $dependency ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1534 |
$dependent_names = WP_Plugin_Dependencies::get_dependent_names( $dependency ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1535 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1536 |
if ( empty( $dependent_names ) ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1537 |
return; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1538 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1539 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1540 |
$dependency_note = __( 'Note: This plugin cannot be deactivated or deleted until the plugins that require it are deactivated or deleted.' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1541 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1542 |
$comma = wp_get_list_item_separator(); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1543 |
$required_by = sprintf( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1544 |
/* translators: %s: List of dependencies. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1545 |
__( '<strong>Required by:</strong> %s' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1546 |
implode( $comma, $dependent_names ) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1547 |
); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1548 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1549 |
printf( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1550 |
'<div class="required-by"><p>%1$s</p><p>%2$s</p></div>', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1551 |
$required_by, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1552 |
$dependency_note |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1553 |
); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1554 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1555 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1556 |
/** |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1557 |
* Prints a list of other plugins that the plugin depends on. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1558 |
* |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1559 |
* @since 6.5.0 |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1560 |
* |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1561 |
* @param string $dependent The dependent plugin's filepath, relative to the plugins directory. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1562 |
*/ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1563 |
protected function add_dependencies_to_dependent_plugin_row( $dependent ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1564 |
$dependency_names = WP_Plugin_Dependencies::get_dependency_names( $dependent ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1565 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1566 |
if ( array() === $dependency_names ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1567 |
return; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1568 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1569 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1570 |
$links = array(); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1571 |
foreach ( $dependency_names as $slug => $name ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1572 |
$links[] = $this->get_dependency_view_details_link( $name, $slug ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1573 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1574 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1575 |
$is_active = is_multisite() ? is_plugin_active_for_network( $dependent ) : is_plugin_active( $dependent ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1576 |
$comma = wp_get_list_item_separator(); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1577 |
$requires = sprintf( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1578 |
/* translators: %s: List of dependency names. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1579 |
__( '<strong>Requires:</strong> %s' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1580 |
implode( $comma, $links ) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1581 |
); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1582 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1583 |
$notice = ''; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1584 |
$error_message = ''; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1585 |
if ( WP_Plugin_Dependencies::has_unmet_dependencies( $dependent ) ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1586 |
if ( $is_active ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1587 |
$error_message = __( 'This plugin is active but may not function correctly because required plugins are missing or inactive.' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1588 |
} else { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1589 |
$error_message = __( 'This plugin cannot be activated because required plugins are missing or inactive.' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1590 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1591 |
$notice = wp_get_admin_notice( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1592 |
$error_message, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1593 |
array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1594 |
'type' => 'error', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1595 |
'additional_classes' => array( 'inline', 'notice-alt' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1596 |
) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1597 |
); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1598 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1599 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1600 |
printf( |
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1601 |
'<div class="requires"><p>%1$s</p>%2$s</div>', |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1602 |
$requires, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1603 |
$notice |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1604 |
); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1605 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1606 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1607 |
/** |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1608 |
* Returns a 'View details' like link for a dependency. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1609 |
* |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1610 |
* @since 6.5.0 |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1611 |
* |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1612 |
* @param string $name The dependency's name. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1613 |
* @param string $slug The dependency's slug. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1614 |
* @return string A 'View details' link for the dependency. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1615 |
*/ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1616 |
protected function get_dependency_view_details_link( $name, $slug ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1617 |
$dependency_data = WP_Plugin_Dependencies::get_dependency_data( $slug ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1618 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1619 |
if ( false === $dependency_data |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1620 |
|| $name === $slug |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1621 |
|| $name !== $dependency_data['name'] |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1622 |
|| empty( $dependency_data['version'] ) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1623 |
) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1624 |
return $name; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1625 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1626 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1627 |
return $this->get_view_details_link( $name, $slug ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1628 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1629 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1630 |
/** |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1631 |
* Returns a 'View details' link for the plugin. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1632 |
* |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1633 |
* @since 6.5.0 |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1634 |
* |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1635 |
* @param string $name The plugin's name. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1636 |
* @param string $slug The plugin's slug. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1637 |
* @return string A 'View details' link for the plugin. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1638 |
*/ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1639 |
protected function get_view_details_link( $name, $slug ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1640 |
$url = add_query_arg( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1641 |
array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1642 |
'tab' => 'plugin-information', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1643 |
'plugin' => $slug, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1644 |
'TB_iframe' => 'true', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1645 |
'width' => '600', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1646 |
'height' => '550', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1647 |
), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1648 |
network_admin_url( 'plugin-install.php' ) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1649 |
); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1650 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1651 |
$name_attr = esc_attr( $name ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1652 |
return sprintf( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1653 |
"<a href='%s' class='thickbox open-plugin-details-modal' aria-label='%s' data-title='%s'>%s</a>", |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1654 |
esc_url( $url ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1655 |
/* translators: %s: Plugin name. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1656 |
sprintf( __( 'More information about %s' ), $name_attr ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1657 |
$name_attr, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1658 |
esc_html( $name ) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1659 |
); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1660 |
} |
0 | 1661 |
} |