Yoast_Notification_Center::clear_dismissal()
Clear dismissal information for the specified Notification.
When a cause is resolved, the next time it is present we want to show the message again.
Метод класса: Yoast_Notification_Center{}
Хуков нет.
Возвращает
true|false
.
Использование
$Yoast_Notification_Center = new Yoast_Notification_Center(); $Yoast_Notification_Center->clear_dismissal( $notification );
- $notification(строка|Yoast_Notification) (обязательный)
- Notification to clear the dismissal of.
Код Yoast_Notification_Center::clear_dismissal() Yoast Notification Center::clear dismissal Yoast 20.3
public function clear_dismissal( $notification ) { global $wpdb; if ( $notification instanceof Yoast_Notification ) { $dismissal_key = $notification->get_dismissal_key(); } if ( is_string( $notification ) ) { $dismissal_key = $notification; } if ( empty( $dismissal_key ) ) { return false; } // Remove notification dismissal for all users. $deleted = delete_metadata( 'user', 0, $wpdb->get_blog_prefix() . $dismissal_key, '', true ); // Delete unprefixed user meta too for backward-compatibility. $deleted = delete_metadata( 'user', 0, $dismissal_key, '', true ) || $deleted; return $deleted; }