Set user loggin status?

Use wp_signon(). Ex: $creds = array(); $creds[‘user_login’] = ‘example’; $creds[‘user_password’] = ‘plaintextpw’; $creds[‘remember’] = true; $user = wp_signon( $creds, false ); if ( is_wp_error($user) ) echo $user->get_error_message(); See Codex for more details about wp_signon().

WordPress change author email notify message?

$comment_id can be passed as second parameter to your function. Modify you add_filter: add_filter(‘comment_notification_text’, ‘myfunction’, 10, 2); Then get $comment and $post from $comment_id: function myfunction( $notify_message, $comment_id ) { $comment = get_comment( $comment_id ); $post = get_post($comment->comment_post_ID);

Display tags with a twist

the_tags() is simple for convenience, if you want more control over formatting, use get_the_tags() and output them however you want. EDIT – quick example for the template: <?php $posttags = get_the_tags(); if ($posttags) { echo ‘Read more about ‘; $tag_count = count( $posttags ); $count = 0; foreach( $posttags as $tag ) { $count++; if( … Read more

Get multiple db prefix with $wpdb

Write a function that uses $wpdb->prefix as a fallback. Something like this: function wpse65880_table_with_prefix($table) { // should define array in config file, rather than hard coding $my_tables = array(“table1”, “table2”, “table3”, “table4”); if (in_array($table, $my_tables)) { // “qa_” should also be a config file setting return “qa_” . $table; } else return $wpdb->prefix . $table; … Read more

Can I create front-end editable user profile pages with WordPress? How do I do it?

Rarely do I answer question with simply a plugin recommendation – and I’d never recommend a commercial one – but since there’s a really good plugin for the task of front end profiles/login and such out there, I cannot let it go unmentioned: Check out Theme-My-Login by Jeff Farthing. There ain’t no better solution. It’s … Read more