Updating User Meta from Custom Post Field Upon Publish Not Working

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

Dynamically Generating User Meta Field

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

Multisite – Echo admins profile meta

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

Conditionally process comments while ignoring replies

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

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