Tag Info

New answers tagged

1

Make sure to have identical keys in both of the arrays. Keys 'first_name', 'last_name' and respective keys 'fname', 'lname' are different. If you can make them identical then first do it, otherwise you will either need to do string manipulation for these keys before using them or put a condition like below in the foreach loop - foreach($user_meta_fields as ...


0

You should enable WP_DEBUG mode, so that the white screen of death will give you a more useful error message. The white screen could be caused by a typo, but it looks ok to me. Does your host have simplexml_load_string()? If you don't have the simple XML library, that could be why returning $setlink works, while returning $setfound causes WSOD. I've ...


0

Solution found : to make a case-sensitive search for a meta_key / meta_value pair : a hardcoded mysql query on the usermeta table with the BINARY keyword, with get_results() method of $wpdb object: global $wpdb; $sql = $wpdb->prepare( "SELECT user_id FROM {$wpdb->prefix}usermeta WHERE meta_key = 'unique_id' ...


1

Edit: The meta_key is case insensitive by default because the default collation on the relevant tables is "utf8_general_ci", which uses case insensitive sorting for text comparisons. If you change the collation of the rows in the database, you can change the sort order and thus whether it is case sensitive or not. You can also use the DB_COLLATE define in ...


0

It looks like the plugin is using the update_post_meta function, which in turn uses the update_metadata function which includes the action hooks update_postmeta and updated_postmeta which fire immediately before and after the post meta is stored to the database. You could hook into one of these to update the user meta of the author of the post. Pseudo code: ...


0

But when I update the page it shows the previous values saved in the back-end (admin) section of wordpress. Of course, any values saved in the back end are saved correctly and displayed on the front-end. I wanted to save either way, from back-end and from front-end. Just had this problem myself. Given that the meta was in fact updating but just not ...



Top 50 recent answers are included