php – remove values within an array user meta

Question

hello I save the values as here:
Add value to usermeta without removing previous values?

$dismissed = array_filter( explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) ) );

if ( ! in_array( $new_pointer, $dismissed ) ) {
    $dismissed[] = $new_pointer;
    $dismissed = implode( ',', $dismissed );

    update_user_meta( get_current_user_id(), 'dismissed_wp_pointers', $dismissed );
}

the problem is that I can’t delete them

in my role I save emails from subscribing users so I need to be able to delete an email when someone wants to do it

try delete_user_meta, using the same code but it doesn’t work

0
mario 1 year 2021-11-20T17:02:24-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse