Changeset 57769
- Timestamp:
- 03/05/2024 06:25:22 AM (7 months ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-plugins-list-table.php
r57714 r57769 1568 1568 } 1569 1569 1570 $dependency_note = __( 'Note: This plugin cannot be activated until the plugins that are required by it are activated.' ); 1571 1572 $comma = wp_get_list_item_separator(); 1573 $requires = sprintf( 1570 $is_active = is_multisite() ? is_plugin_active_for_network( $dependent ) : is_plugin_active( $dependent ); 1571 $comma = wp_get_list_item_separator(); 1572 $requires = sprintf( 1574 1573 /* translators: %s: List of dependency names. */ 1575 1574 __( '<strong>Requires:</strong> %s' ), … … 1577 1576 ); 1578 1577 1578 $notice = ''; 1579 $error_message = ''; 1580 if ( WP_Plugin_Dependencies::has_unmet_dependencies( $dependent ) ) { 1581 if ( $is_active ) { 1582 $error_message = __( 'This plugin is active but may not function correctly because required plugins are missing or inactive.' ); 1583 } else { 1584 $error_message = __( 'This plugin cannot be activated because required plugins are missing or inactive.' ); 1585 } 1586 $notice = wp_get_admin_notice( 1587 $error_message, 1588 array( 1589 'type' => 'error', 1590 'additional_classes' => array( 'inline', 'notice-alt' ), 1591 ) 1592 ); 1593 } 1594 1579 1595 printf( 1580 1596 '<div class="requires"><p>%1$s</p><p>%2$s</p></div>', 1581 1597 $requires, 1582 $ dependency_note1598 $notice 1583 1599 ); 1584 1600 } -
trunk/src/wp-includes/class-wp-plugin-dependencies.php
r57736 r57769 370 370 public static function display_admin_notice_for_unmet_dependencies() { 371 371 if ( in_array( false, self::get_dependency_filepaths(), true ) ) { 372 $error_message = __( 'Some required plugins are missing or inactive.' ); 373 374 if ( is_multisite() ) { 375 if ( current_user_can( 'manage_network_plugins' ) ) { 376 $error_message .= ' ' . sprintf( 377 /* translators: %s: Link to the network plugins page. */ 378 __( '<a href="%s">Manage plugins</a>.' ), 379 esc_url( network_admin_url( 'plugins.php' ) ) 380 ); 381 } else { 382 $error_message .= ' ' . __( 'Please contact your network administrator.' ); 383 } 384 } elseif ( 'plugins' !== get_current_screen()->base ) { 385 $error_message .= ' ' . sprintf( 386 /* translators: %s: Link to the plugins page. */ 387 __( '<a href="%s">Manage plugins</a>.' ), 388 esc_url( admin_url( 'plugins.php' ) ) 389 ); 390 } 391 372 392 wp_admin_notice( 373 __( 'There are additional plugin dependencies that must be installed.' ),393 $error_message, 374 394 array( 375 'type' => ' info',395 'type' => 'warning', 376 396 ) 377 397 );
Note: See TracChangeset
for help on using the changeset viewer.