update_post_meta not saving when value is zero
update_post_meta() calls update_metadata which begins with this line: if ( !$meta_type || !$meta_key ) return false; I wrote a simple test (with a lot of cut & paste) to see how string values of 0 are evaluated (instead of looking it up in the PHP manual): <?php $meta_key = (string) 0; if ( ! $meta_key … Read more