0

I have a user meta key prize which is an array contains prize type and prize date. The date in unix timestamp. How I can delete the user meta by specify the prize date only?

Example code:

delete_user_meta( $userID, 'prize', $meta_value ); 
$meta_value = array(
    'prize' => array(
         // Add something here like prize date = 1506556467
    ) , 
);

Key value in the database look like this:

a:2:{i:0;s:17:"prize name";i:1;i:1506556467;}

And what if I want to delete the metakeys if the value in between 2 integer like 1506550000 and 1506550001 for example.

1 Answer 1

0

The $meta_value is optional and I you will be having a unique entry of prize for each user so you can just use the function without $meta_value.

delete_user_meta( $userID, 'prize' ); 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.