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

metabox with custom post type values

the old way when i say “the old way” i mean my old way of doing this ,like i answered Need Help Finding a WordPress E-Commerce Plugin That Utilises Custom Post Types before about creating relations between custom post types that i used custom fields for that meaning: Author will have two custom fields (book_ids[], … Read more

Metabox saves on Update or Publish, but not on Saving Draft

So you first tried hooking on to wp_insert_post_data and could save the meta data when saving Drafts but not when publishing. Then you tried hooking on to save_post and could save meta data when publishing but not when saving Drafts. The easiest solution would be to hook on to both. add_action(‘save_post’, ‘save_details’); add_action(‘wp_insert_post_data’, ‘save_details’); Edit … Read more

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