should_display_compatibility_notices() WC 2.5.0
Whether notices must be displayed in the current page (plugins and WooCommerce pages).
Хуков нет.
Возвращает
null
. Null. Ничего.
Использование
should_display_compatibility_notices();
Список изменений
С версии 2.5.0 | Введена. |
Код should_display_compatibility_notices() should display compatibility notices WC 5.1.0
function should_display_compatibility_notices() {
$current_screen = get_current_screen();
if ( ! isset( $current_screen ) ) {
return false;
}
$is_plugins_page =
property_exists( $current_screen, 'id' ) &&
'plugins' === $current_screen->id;
$is_woocommerce_page =
property_exists( $current_screen, 'parent_base' ) &&
'woocommerce' === $current_screen->parent_base;
return $is_plugins_page || $is_woocommerce_page;
}