Let users register weight each day and save it in DB
I feel the best way to do is add two options Body weight and Body fat(%) in the user profile, and then you can show it with the user logged from the db. I guess this would be a simpler way.
I feel the best way to do is add two options Body weight and Body fat(%) in the user profile, and then you can show it with the user logged from the db. I guess this would be a simpler way.
One way to do it is by creating a CPT for user profiles, and creating one “post” of that type per each user. Remove the user’s ability to add or remove osts and let him edit that post. This will make searching easier as you simply restrict the search for the specific CPT.
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
So the theme I used was not firing add_action( ‘publish_place’, ‘update_package_id’ ); or any of it’s variations e.g. save_post So I created a custom hook in the functions.php file of the theme which got the post id from the url (see $_REQUEST[‘pid’]) here’s what it looked like: function update_package_id() { $postinfo = $_REQUEST[‘pid’]; $post = … Read more
Update user meta using Ajax on front end?
After some help with a PHP developer, it seems the main code above was close but certain changes were made. Here is the code for those interested. In this code, the custom post type is: Course. Change accordingly if needed for your own use. function save_educadme_courses_for_user( $user_id ) { if ( !current_user_can( ‘edit_user’, $user_id ) … Read more
How to Update User Meta Field other than from profile?
I had this same problem and I found that the blogtemplates plugin was deleting my options after I updated them. You may have a similar situation. I fixed my case by making my wpmu_new_blog hook execute after blog templates. // blogtemplates executes at 9999, go last at 10000 add_action(‘wpmu_new_blog’, ‘process_extra_field_on_blog_signup’, 10000, 6);
According to the Codex, get_user_id_from_string() is deprecated, and should be replaced with get_user_by(). <p> <?php $thisblog = get_current_blog_id(); // probably don’t need this anymore $admin_email = trim( get_option( ‘admin_email’ ) ); $admin_user = get_user_by( ’email’, $admin_email ) ); $phone_number = get_user_meta($admin_user->ID, ‘phone’, true); if($phone_number!=”) { ?> <?php echo $phone_number; ?> <?php } else { ?> … Read more
Simply check if the comment has a parent before decrementing points. Reading the Codex entry for the get_comment() function, you’ll note that in the manner you use the function you will be returned an object containing keys that correspond to the column names of the wp_comments table. Viewing the wp_comments scehma, note that there is … Read more