Changeset 44939 – WordPress Trac (original) (raw)

Timestamp:

03/20/2019 02:58:03 PM (7 years ago)

desrosj

Message:

Plugins: Block plugin updates on the update screen if required PHP version is not supported.

This brings the changes in [44937] to the WordPress Updates page in the admin. Now, when a site does not meet the minimum PHP version requirements for a plugin update, the user will not be able to update. Instead, they will be presented with educational information to guide them through the process of updating PHP.

Props afragen, miyauchi, TimothyBlynJacobs, desrosj.
Fixes #44350.

File:

Legend:

Unmodified

Added

Removed

r44700 r44939
295 295 }
296 296 }
297
298 compatiblephp=(empty(compatible_php = ( empty( compatiblephp=(empty(plugin_data->update->requires_php ) |
299
300 if ( ! $compatible_php && current_user_can( 'update_php' ) ) {
301 $compat .= '
' . __( 'This update doesn’t work with your version of PHP.' ) . ' ';
302 /* translators: %s: Update PHP page URL */
303 $compat .= sprintf(
304 __( 'Learn more about updating PHP.' ),
305 esc_url( wp_get_update_php_url() )
306 );
307 $compat .= '

' . wp_get_update_php_annotation() . '';

308 }
309
297 310 // Get the upgrade notice for the new plugin version.
298 311 if ( isset( $plugin_data->update->upgrade_notice ) ) {
316 329
317 330
331
318 332 <input type="checkbox" name="checked[]" id="checkbox_id;?>"value="<?phpechoesc_attr(checkbox\_id; ?>" value="<?php echo esc\_attr( checkbox_id;?>"value="<?phpechoesc_attr(plugin\_file ); ?>" />
319 333
326 340 ?>
327 341
342
328 343
329 344

330
345
331 346 Name; ?>
332 347 <?php
337 352 $plugin_data->update->new_version
338 353 );
339 echo ' ' . details.details . details.compat . $upgrade_notice;
354 echo ' ' . details.details . details.compat . $upgrade_notice;
340 355 ?>
341 356

342 357
343 <?php
358 <?php
344 359 }
345 360 ?>

Note: See TracChangeset for help on using the changeset viewer.