custom fields - Wordpress update_post_meta does not update dynamic values -



custom fields - Wordpress update_post_meta does not update dynamic values -

this little strange, using "update_post_meta" update custom fields in wordpress. when run update_post_meta($post_id, 'test_field', 'test value'); custom field updates without problem when utilize string value not update:

$test_value = "test"; echo $test_value; // no problem here echo $post_id; // no problem here update_post_meta($post_id, 'test_field', $test_value);

thanks much in advance help

stu

try cast variables types. seek this:

update_post_meta( (int) $post_id, 'test_field', (string) $test_value );

wordpress custom-fields

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -