Show admin help message across custom post type parent and child posts

You’ll need to check the $pagenow variable and the post type of the post being edited. It will look something like this: function wpse_75224_admin_notices() { global $pagenow; $is_edit_custom_post_type = ( ‘post.php ‘ == $pagenow && ‘my_custom_post_type’ == get_post_type( $_GET[‘post’] ) ); $is_new_custom_post_type = ( ‘post-new.php’ == $pagenow && ‘my_custom_post_type’ == $_GET[‘post_type’] ); $is_all_post_type = ( … Read more

If new comment posted in custom post – send notification to custom email from custom field

You can try something like this in your functions.php function send_comment_email_notification( $comment_ID, $commentdata ) { $comment = get_comment( $comment_id ); $postid = $comment->comment_post_ID; $master_email = get_post_meta( $postid, ‘master_email’, true); if( isset( $master_email ) && is_email( $master_email ) ) { $message=”New comment on <a href=”” . get_permalink( $postid ) . ‘”>’ . get_the_title( $postid ) . … Read more

email wordpress users using BCC

First: Don’t use mail(). Use wp_mail() instead. wp_mail( // Send it to yourself get_option( ‘admin_email’ ), ‘Your subject’, ‘Your message’, // extra headers array ( ‘Bcc:’ . implode( “,”, $usersarray ), ‘From:’ . get_option( ‘admin_email’ ) ) );

Show Admin Message on Redirect

Here’s an updated version of your code that also handles the notification message using the Transients API. /** * If post status is pending, set transient containing error message and * change the redirect location. * Filters slashed post data just before it is inserted into the database. * * @param array $data An array … Read more

Remove Update Notification (for all users except ADMIN)

this works fine for a specific user login: global $user_login; get_currentuserinfo(); if ($user_login !== “admin”) { // change admin to the username that gets the updates add_action( ‘init’, create_function( ‘$a’, “remove_action( ‘init’, ‘wp_version_check’ );” ), 2 ); add_filter( ‘pre_option_update_core’, create_function( ‘$a’, “return null;” ) ); } and this for a specific user id: global $user_ID; … Read more

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