get_post_meta not returning results
-
I’ve had to write a workaround for my site because Polylang seems to be affecting the wordpress get_post_meta function.
I was trying to get results of a post meta relationship for a specific post id.
On a different language other than en_GB it seems to stop the function returning an array of results.$meta_key = "your_key"; $meta_key = "your_post_id"; $sql = $wpdb->prepare( "SELECT meta_value FROM {$wpdb->postmeta} WHERE meta_key = %s AND post_id = %s", $meta_key, $post_id ); $related_ids = $wpdb->get_col($sql);
this strangely provides a different result than using get_post_meta.
I did not want to sync my custom fields as it creates a huge overhead.I don’t know if this is a bug or by design.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘get_post_meta not returning results’ is closed to new replies.