Redirect current user to their most recent custom post

To get the permalink of a users most recent post (of custom post type) perform the following query: $latest = get_posts(array( ‘author’ => $current_user->ID, ‘orderby’ => ‘date’, ‘post_type’ => ‘my_custom_post_type’, ‘order’ => ‘desc’, ‘numberposts’ => 1, )); if( $latest ) { $url = get_permalink($latest[0]->ID); } else { // No posts } For the redirect part … Read more

SELECT from wp_users, get Displayname too

You will need to do a JOIN on the users table in your old database, and also select the display name. One key thing to note here, is that I aliased dbold_posts as P, and dbold_users as U – when dealing with multiple table, it’s always best practice to specify which table you are referring … Read more

Get current user array into hyperlink

I would set up an array with the variables you want in the url query string and then use http_build_query(). Like so: $args = array( ‘AT’ => ‘EN’, ‘AE’ => $current_user->user_email, ‘FN’ => $current_user->user_firstname, ‘LN’ => $current_user->user_lastname, ‘MK’ => 665080128, ‘PW’ => ‘miami’, ‘BU’ => ‘http://thinkmcat.com/’); ?> <a href=”https://thinkmcat.webex.com/thinkmcat/m.php?<?php echo http_build_query($args); ?>”>LINK</a>