Can I mass change all admin emails for a multisite instance?

Okay so thanks to the suggestion from Rup I got this to work and apply to all my sites locally (will double check this before using on live!) $blogs = get_sites([‘public’ => 1, ‘orderby’ => ‘registered’, ‘order’ => ‘DESC’, ‘number’ => 1000]); foreach($blogs as $blog) { $bid = $blog->blog_id; switch_to_blog($bid); update_option( ‘admin_email’, ‘[email protected]’ ); update_option( … Read more

Send email button in custom post type backend

Solved this using AJAX. Here is my updated code: <?php add_action(‘wp_ajax_quote_email_pdf’, ‘quote_email_pdf’); function quote_email_pdf() { wp_mail( $to, $subject, $message, $headers, $attachments ); die(); } ?> <button class=”button” id=”downloadQuote”>Send email</button> <script> jQuery(document).ready(function($){ const fullName = $(‘#quoteFullName’).text(); const emailAddress = $(‘#quoteEmail a’).text(); $(‘#downloadQuote’).click(function(e){ e.preventDefault(); $.ajax({ url: sf_admin_ajax.sf_admin_ajax_url, type: ‘POST’, data: { action: ‘quote_email_pdf’, emailAddress: emailAddress, fullName: fullName … Read more

Mechanism to send to users of secured WordPress install new notifications by SMS or email?

I’d say there’s three specific requirements here; Allow users to choose notification times, timezone aware Hook into transition_post_status to listen up for new posts, and then take action Find a decent SMS API For 1), hook into show_user_profile to output your time picker field(s), and personal_options_update to save them. You could detect the user’s timezone … Read more

Send email only upon draft

$post_id is an integer (just the post id) and not a post object (the whole post with id,status,title …) so globalize the $post object and check the status from there eg: function er_send_email_on_post_draft_save( $post_id ) { global $post; //verify post is not a revision if ( $post->post_status == ‘draft’ ) { $post_title = get_the_title( $post_id … Read more

Send email daily from WordPress site

Unfortunately the WordPress cron jobs are only triggered when your site is visited This is true. The only way to reliably execute code (even if visitors don’t visit your site) is to use the unix cron functions. You can just setup a unix cron job that will do a wget on your homepage. Edit: You … Read more

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