Author custom fields post meta, the code?
get_the_author_meta() != get_user_meta(). Change to: echo get_the_author_meta(‘address’, $thisauthorID);
get_the_author_meta() != get_user_meta(). Change to: echo get_the_author_meta(‘address’, $thisauthorID);
You need to hook edit_user_profile to add your custom inputs. Then, you need to hook the profile_update action and use the function add_user_meta to add the metadata
Could be because you are passing an array of array try this: <?php $my_query = new WP_Query(); $my_query->query(array( ‘post__in’ => $curauth->user_favourite_post)); while ($my_query->have_posts()) : $my_query->the_post(); ?> <h3><a href=”https://wordpress.stackexchange.com/questions/27808/<?php the_permalink(); ?>”><?php the_title(); ?></a></h3> <?php endwhile; ?>
Every user can set this value on the My Sites admin screen. It defaults to the first blog a user created in the MultiSite instance, if it’s unset and the user creates a new blog, that blog becomes his primary blog.
The last parameter of update_user_meta(), the previous value, is an optional parameter. If it’s set it checks whether the value in the database is indeed the one you fed update_user_meta(). If you set that paramteter by grabbing the value from the database, it is completely redundant. So first off, omit that. That being said, this … Read more
I would solve this creating two extra Custom Fields: _score_last _score_variation The first underscore makes the CF invisible in the Admin area. Drop the following code in your theme’s functions.php: if( is_admin() ) { add_action( ‘save_post’, ‘wpse_57217_check_customfield_variation’, 11, 2 ); } function wpse_57217_check_customfield_variation( $post_id, $post ) { if ( ( defined( ‘DOING_AUTOSAVE’ ) && DOING_AUTOSAVE … Read more
Instead of saving the URL of the sideloaded file, save its ID. You can then attach post meta or a tax term to the new attachment indicating its album art. That way your meta stores the ID of the current cover, and if you want a selection, just show attachments that are images with the … Read more
I found a way to do it in author.php file Just use the following to display the Google+ and Twitter links: <?php $curauth = (isset($_GET[‘author_name’])) ? get_user_by(‘slug’, $author_name) : get_userdata(intval($author)); echo $curauth->googleplus; echo $curauth->twitter; ?>
User levels are deprecated, not obsolete. Deprecated features should still be expected to work but should not be used in new code. The point of deprecation is to provide code authors time to update software and thus avoid breakages when the deprecated feature are finally removed. Leave this alone. Besides which, it is a very … Read more
It was actually much easier than I originally thought – just doing a WP_User_Query for a meta value (meta arrays are supported as well, like for the other query classes). public function on_deactivate() { $meta_key = ‘tools_page_tsi_per_page’; $query = new WP_User_Query( array( ‘meta_key’ => $meta_key ) ); if ( empty( $query->results ) ) return; foreach … Read more