WP Cron: Save third party data as user meta

An alternative way to do what I wanted : Save the time when the action has been ran and check the difference with actual time : function my_save_statistiques( $user_id ) { $user_id = get_current_user_id(); $current_time = time(); if (empty($current_time)) { update_usermeta( $user_id, ‘last_analytics’, $current_time ); } $last_analytics = get_user_meta( $user_id, ‘last_analytics’, true ); $diff = … Read more

How to delete user meta by key

You’re data is stored in a serialized array in the database, per a comment to the question: … it’s stored as the api’s working for. It looks like that in the database : `a:3:{i:0;a:1:{s:5:”titre”;s:3:”sfg”;}i:1;a:1:{s:5:”titre”;s:4:”test”;}i:2;a:1:{s‌​:5:”titre”;s:4:”test”;}}` You are trying to remove only part of that serialized array by passing the key to delete_user_meta(). That is not how … Read more

Store Foreach in user profile

Your problem is here: $my_graph =. At every iteration you are resetting the entire string to a new value. You need $my_graph .= — notice the .— to concatenate a string together. That is a PHP syntax problem. I don’t think I would do it this way though. update_usermeta() will serialize an array or object … Read more

Hide user fields based off capability

This filter needs to return something. Try this function modify_contact_methods($profile_fields) { if(current_user_can(‘edit_users’)) { // Field addition and removal will be done here // Add new fields $profile_fields[‘company_name’] = ‘Company Name’; $profile_fields[‘company_id’] = ‘Company ID’; } return $profile_fields; } add_filter(‘user_contactmethods’, ‘modify_contact_methods’);

WordPress Author Information show paragraph?

Use wpautop() https://codex.wordpress.org/Function_Reference/wpautop Example <?php ///MUST BE IN A LOOP echo wpautop(get_the_author()); ///MUST BE IN A LOOP ?> So you will need to find out where author name are being displayed in the code. Normally the default file is author.php

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