Stopping People Viewing Draft Posts

Yes, you (read: the logged in user) will be able to see the drafted post. But, a guest will not be able to read it. To test it, login to one browser and create a draft. See its URL in another browser where you don’t login (no cookie, etc).

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);

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