New answers tagged

5

In layman terms there is no major difference! update_user_option() uses update_user_meta() internally. The only difference is update_user_option() prefix the option name with database table prefix + blog ID if you are in multisite and just table prefix if you are in single site installation. Take a look at the code of update_user_option() /** * Update ...


5

Both write their data in the “usermeta” table. User options stored in the usermeta table retain the wordpress table prefix e.g. wp_ whereas the user meta also stored in the usermeta table doesn't. User options support blog-specific options, useful in multisite. The user meta is based on the user id specific meta data like profile information. The ...


0

Use PHP explode function and convert string into array using a delimiter | then you can use foreach loop. Example:- $str = get_the_author_meta('my_pet', $author_id); $pets_array = explode('| ', $str); if (is_array($pets_array)) { foreach ($pets_array as $pet) { echo $pet; echo 'somtext'; echo '<br />'; } }



Top 50 recent answers are included