user profile replace first name last name with custom values
The solution was to move the update_options into the second function.
The solution was to move the update_options into the second function.
You should be able to do this with Diverse Solutions, however you may need more than one product, depending on how you set it up. First, you’ll need to use our mapping IDX product dsSearchAgent to create a custom filter (we call these “links”) for each agent. Just login to your Control Panel, select “Links” … Read more
First af all if (null === $read_notices) is never true, because get_user_meta return false or empty string or empty array. Never return null. Right way is check if it is empty: if ( empty ($read_notices) ) { … } Then your problem is that using get_user_meta without passing the 3rd parameter as true will return … Read more
Please look at the last two lines of code. I am trying to print the id of the user. It works when used in the theme files but not inside the plugin. //Test Usermeta $user = get_userdatabylogin(‘vijay’); echo $user->ID; // prints the id of the user; In PHP, you cannot (normally) execute a user function … Read more
you can store user data in user meta fields which you can get and display to the user. use update_user_meta(); function to store user data and use get_user_meta(); to retrieve stored user data. // you need to get user id and replace meta_key with yours $user_data=”some user lists data”; update_user_meta($user_id, ‘meta_key’, $user_data); // now get … Read more
use single form to enter multiple profiles
The default login form is not very developer friendly (and it is more developer friendly now than it used to be). If you browse the source for that page you should be able to convince yourself of that. Your plugin is not going to be able to manipulate the page the way you hope. A … Read more
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
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
Just alter your database query to also grab the user ID, and then return an array of data objects (as opposed to just the meta value): function get_meta_values( $key, $type=”workout”, $status=”publish” ) { global $wpdb; if ( empty( $key ) ) return; $r = $wpdb->get_results( $wpdb->prepare( ” SELECT pm.meta_value, p.post_author FROM {$wpdb->postmeta} pm LEFT JOIN … Read more