Skip to content

Commit 219e081

Browse files
maurisrxborkweb
andauthored
Fix: user preferences retrieval in site with custom DB prefix (#8)
Co-authored-by: Matthew Batchelder <borkweb@gmail.com>
1 parent 7dc21e6 commit 219e081

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"name": "stellarwp/admin-notices",
3-
"version": "1.2.1",
43
"description": "A handy package for easily displaying admin notices in WordPress with simple to complex visibility conditions",
54
"minimum-stability": "stable",
65
"license": "MIT",

src/Actions/DisplayNoticesInAdmin.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,9 @@ private function passesScreenConditions(AdminNotice $notice): bool
165165
*/
166166
private function passesDismissedConditions(AdminNotice $notice): bool
167167
{
168-
$userPreferences = get_user_meta(get_current_user_id(), 'wp_persisted_preferences', true);
168+
global $wpdb;
169+
170+
$userPreferences = get_user_meta(get_current_user_id(), $wpdb->get_blog_prefix() . 'persisted_preferences', true);
169171

170172
$key = "stellarwp/admin-notices/$this->namespace";
171173
if (!is_array($userPreferences) || empty($userPreferences[$key])) {

0 commit comments

Comments
 (0)