Merged in feature/280-dev-dev01 (pull request #21)

auto-patch  280-dev-dev01-2024-01-19T16_41_58

* auto-patch  280-dev-dev01-2024-01-19T16_41_58
This commit is contained in:
Tony Volpe
2024-01-19 16:44:43 +00:00
parent 2699b5437a
commit be83910651
2125 changed files with 179300 additions and 35639 deletions

View File

@@ -280,6 +280,19 @@ class WC_Admin_Notices {
do_action( 'woocommerce_hide_' . $name . '_notice' );
}
/**
* Check if a given user has dismissed a given admin notice.
*
* @since 8.5.0
*
* @param string $name The name of the admin notice to check.
* @param int|null $user_id User id, or null for the current user.
* @return bool True if the user has dismissed the notice.
*/
public static function user_has_dismissed_notice( string $name, ?int $user_id = null ): bool {
return (bool) get_user_meta( $user_id ?? get_current_user_id(), "dismissed_{$name}_notice", true );
}
/**
* Add notices + styles if needed.
*/