WP_Plugin_Dependencies::display_admin_notice_for_unmet_dependencies()
Displays an admin notice if dependencies are not installed.
Метод класса: WP_Plugin_Dependencies{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$result = WP_Plugin_Dependencies::display_admin_notice_for_unmet_dependencies();
Список изменений
С версии 6.5.0 | Введена. |
Код WP_Plugin_Dependencies::display_admin_notice_for_unmet_dependencies() WP Plugin Dependencies::display admin notice for unmet dependencies WP 6.6.2
public static function display_admin_notice_for_unmet_dependencies() { if ( in_array( false, self::get_dependency_filepaths(), true ) ) { $error_message = __( 'Some required plugins are missing or inactive.' ); if ( is_multisite() ) { if ( current_user_can( 'manage_network_plugins' ) ) { $error_message .= ' ' . sprintf( /* translators: %s: Link to the network plugins page. */ __( '<a href="%s">Manage plugins</a>.' ), esc_url( network_admin_url( 'plugins.php' ) ) ); } else { $error_message .= ' ' . __( 'Please contact your network administrator.' ); } } elseif ( 'plugins' !== get_current_screen()->base ) { $error_message .= ' ' . sprintf( /* translators: %s: Link to the plugins page. */ __( '<a href="%s">Manage plugins</a>.' ), esc_url( admin_url( 'plugins.php' ) ) ); } wp_admin_notice( $error_message, array( 'type' => 'warning', ) ); } }