[wp-hackers] array_push on update_user_meta

BenderisGreat greglancaster71 at gmail.com
Thu Oct 31 17:32:34 UTC 2013


I am not sure exactly how this would work because I start with an empty
meta_value field.  I dont think I can use array_push if there is not at
least one value in the field, correct?  

So maybe something like this:

$profileID = $_POST['profileID'];

$chkMetaValue = get_user_meta($userID,"friends");
	if (!empty($chkMetaValue))
		{
		array_push($profileID);
		} else {
		$profileID;
		}

update_user_meta( $userID, 'friends', $chkMetaValue );

Is that right?




--
View this message in context: http://wordpress-hackers.1065353.n5.nabble.com/array-push-on-update-user-meta-tp42688.html
Sent from the Wordpress Hackers mailing list archive at Nabble.com.


More information about the wp-hackers mailing list