Is it possible in WordPress

Use the project name in the meta key field & the amount donated as the meta value, and I would suggest using update_user_meta rather than add_user_meta because reasons. Something like this: $project=”donated_to_” . $project; update_user_meta( $user_id, $project, $amount ); Apply some sort of logic before setting those variables – you know, in case the user … Read more

How to work with AJAX and WordPress?

You’re not using wordpress default ajax mechanism. To do that: jQuery.ajax({ type: “POST”, url: “/wp-admin/admin-ajax.php”, // Send request to admin-ajax.php data: newcontact, // Can be anything. As per your need action: ‘myaction’, // Required to send otherwise WordPress AJAX won’t authorize your request. success: function(data) { jQuery(“.follow-user”).html(data); } }); AJAX Request Handler add_action( ‘wp_ajax_myaction’, ‘so_wp_ajax_function’ … Read more

update_usermeta don’t work

You should enable WP_DEBUG mode, so that the white screen of death will give you a more useful error message. The white screen could be caused by a typo, but it looks ok to me. Does your host have simplexml_load_string()? If you don’t have the simple XML library, that could be why returning $setlink works, … Read more

Automatically Populate Post Taxonomy Data Based on Post Author Meta Data?

Figured it out for anyone who wants to know: function update_school( $post_id ) { $post_author_id = get_post_field( ‘post_author’, $post_id ); // get the post author ID $school_name = get_the_author_meta( ‘school2’, $post_author_id ); // from the post author ID, get the author meta $term = term_exists( $school_name, ‘school’); wp_set_post_terms( $post_id, $term, ‘school’ ); } // run … Read more