Same email for all comments

Just change to to address for these emails. Sample code, not tested: // hook in late, to avoid side effects. add_filter( ‘comment_notification_headers’, ‘wpse_73855__change_comment_notify_to’ ); function wpse_73855__change_comment_notify_to( $input ) { if ( ‘comment_notification_headers’ === current_filter() ) { add_filter( ‘wp_mail’, __FUNCTION__ ); return $input; } $input[‘to’] = get_option( ‘admin_email’ ); remove_filter( current_filter(), __FUNCTION__ ); return $input; }

Membership subscription, change user role when subscription runs out

Presumably you’ve saved an expiration data somewhere, so setup a wp_cron job to run daily. That job should check the expiration dates, and change the roles for users whose dates are past. if ( ! wp_next_scheduled( ‘alter_user_role_hook’ ) ) { wp_schedule_event( strtotime(‘tomorrow’), ‘daily’, ‘alter_user_role_hook’ ); } function alter_user_role_function() { global $wpdb; $today = date(‘Y-m-d H:i:s’,strtotime(‘today’)); … Read more

Change post status based on user role

I’m then trying to figure out how to change the post status once their subscription is up function downgrade_user_role( $entry, $subscription_id, $transaction_id, $new_payment_amount ) { $user = GFUserData::get_user_by_entry_id( $entry[‘id’] ); $user->set_role( ‘subscriber’ ); global $wpdb; $wpdb->query( $wpdb->prepare( “UPDATE $wpdb->posts SET post_status=”draft” WHERE post_author = %d AND post_status IN (‘publish’, ‘future’)”, $user->ID ) ); } add_action( … Read more

Change sign up fee in cart for subscription products WooCommerce

add_action( ‘woocommerce_before_calculate_totals’, ‘change_subscription_signup_fee’, 1000, 1 ); function change_subscription_signup_fee( $cart ) { if (is_admin() && !defined(‘DOING_AJAX’)) return; if ( did_action( ‘woocommerce_before_calculate_totals’ ) >= 2 ) return; // Loop through cart items foreach ( $cart->get_cart() as $cart_item ) { // Check that product custom cart item data “alredy_have_number” exist and is true if( isset($cart_item[‘alredy_have_number’]) && $cart_item[‘alredy_have_number’] ) … Read more

Email all subscribers when i do an action

You can directly query for users having a specific user_meta value. This will gain some performance over loading all the users first and then iterating over them and loading the meta_value afterwards. Have a look at the WP_User_Query class. If we are speaking of larger numbers of mails you may be better off to use … Read more

Is it possible to install two mail plugins together in a single WordPress site? How to do it? [closed]

You can install our WordPress plugin to synchronise your WordPress subscribers with your SendinBlue account and send newsletters. To do so, we invite you to refer to our step by step guide. In addition, installing SendinBlue plugin for WordPress should not interfere with your current MailPoet plugin. We just ran a test with both SendinBlue … Read more

Tag subscription option in wordpress. How?

If you’re willing to use an outside provider, you can add the tag feed to Feedburner. First get the tag feed: http://www.example.com/?tag=tagname&feed=rss2 Then to to feedburner.com and create a feed, then enable “Email Subscriptions” (under the “Publicize” tab). I’ve done this, and it works well.

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