How would I restrict certain user levels from editing categories

You would need to remove the capability for a Editor role to manage_categories add_action( ‘init’, ‘remove_editor_manage_categories’ ); function remove_editor_manage_categories() { $role = get_role( ‘editor’ ); $role->remove_cap( ‘manage_categories’ ); } Source http://codex.wordpress.org/Function_Reference/remove_cap

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>

Inserting current user ID into Post for Author

You need to use the global variable for the user ID (if you actually need to use it) somewhat like this: global $user_ID; get_currentuserinfo(); The get_currentuserinfo() call will populate the global $user_ID variable which you can then use directly, as you have it in your args currently. Reference

user login and its profile

I’ve just done something like this and it’s fairly simple add_filter(‘wp_nav_menu_items’, ‘add_login_logout_link’, 10, 2); function add_login_logout_link($items, $args) { //check if user is logged in, and add user name to menu if (is_user_logged_in()){ $user = wp_get_current_user(); $items .= ‘<li>’ . $user->display_name . ‘</li>’; } //add login/logout link to menu $items .= ‘<li>’. wp_loginout(get_permalink(),false) .'</li>’; return $items; … Read more

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