Tag Info

New answers tagged

1

First, you should know that current_user_can() only accepts capabilities, not roles, so you are using it wrong and you can end up with unexpected results. That being said, to exlude users form WP_User_Query you can use the exclude parameter: // Get current user data $user = wp_get_current_user(); // Check if current user is a subscriber if( ! empty( $user ...


-1

Following should works for you:- if( current_user_can('read')) { $exclude_user = array(); $exclude_user[] =get_current_user_id(); $args = array( 'role' => 'subscriber', 'exclude' => $exclude_user ); $user_query = new WP_User_Query( $args); foreach ( $user_query->results as $user ) { $mail=$user->user_email; ...


1

You are almost there. You just need to use wp_mail to send emails containing in your array. Here is how you can achieve that using save_post action hook. /** * To send email on updating your event post * * @param int $post_id The post ID. * @param post $post The post object. * @param bool $update Whether this is an existing post being updated or not. ...


1

I just released a plugin to let users use html templates on WordPress and Im playing right now on the dev version to add a simple text fallback. I did the following and in my tests I only see one boundary added and emails are arriving fine to Hotmail. add_action( 'phpmailer_init', array($this->mailer, 'send_email' ) ); /** * Modify php mailer body with ...



Top 50 recent answers are included