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

java - How to pass parameters between Request-Scoped Controllers? -

string - what is the difference between "some" == "some\0" and strcmp("some","some\0") in c++? -

actionscript 3 - Flex: moving a point with rotation doesnt change the point XY? -