Custom notification for contributors when posts are scheduled

Instead of rely on global $post, you should use the post object passed to function via the posts status transition: add_action(‘pending_to_future’, ‘scheduledNotification’); add_action(‘approved_to_future’, ‘scheduledNotification’); function scheduledNotification( $post ) { $author = get_userdata($post->post_author); // the rest of your function here }

WordPress Form To Email.php and Theme

You need to include the wordpress config file: require $_SERVER[‘DOCUMENT_ROOT’].’/wp-config.php’; OR use a page template if your form handler is in your theme. Take a look at using page template’s in wordpress: http://codex.wordpress.org/Page_Templates

Comment notification not working

I do not see the $comment_ID variable having any value in your code. So try by changing the following code wp_notify_postauthor($comment_ID, $comment->comment_type); to wp_notify_postauthor($comment->comment_ID, $comment->comment_type); You can also remove $comment->comment_type as per codex

Email notification

$ticket is a WP_Post object. It should have all of the information you need. Just add that information to the $message string to create whatever content you want. Bare-bones example: $message=”You are viewing “.$ticket->post_title; $message .= ‘Post Content: ‘.$ticket->post_content; $message .= ‘View it: ‘ . get_permalink( $ticket->ID ) . “\nEdit it: ” . get_edit_post_link( $ticket->ID … Read more

Username from e-mail

As far as i know there is no hook or filter to provide a custom User name for default registration process, however if you really want to modify it, you can alter the $_POST data. here is the sample code: add_action(‘wp_loaded’, ‘wpse_138736_filter_username’); function wpse_138736_filter_username(){ //your code to extract username from email $_POST[‘user_login’] = ‘test’; } … Read more

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