How to tell whether a user meta value has increased or decreased [closed]

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

Get the Google+ and Twitter links – WordPress SEO plugin

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; ?>

Query users by capability – uninstall/deactivate callback

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

Average Account Age

WordPress records when a user was registered in the $wpdb->users (usually wp_users) table in the column user_registered. So you can use that to calculate the average account age. There’s no internal function for this, so you’ll have to use $wpdb directly. This stackoverflow answer has some good info about calculating the average of a series … Read more

Store user’s registration date as meta

In your case $registered is the user id not the user object so it does not work. Please use the code as given below. add_action( ‘user_register’, ‘set_user_registration_date’, 10, 1 ); function set_user_registration_date( $user_id ) { $user = get_userdata ( $user_id ); // Update the registration meta data update_user_meta ( $user_id, ‘registration_date’, $user->user_registered ); }

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)