Using wp_editor tinyMCE in metabox cause form alert on leaving page
This is a bug in WP core 5.6.1: https://core.trac.wordpress.org/ticket/52440 which will hopefully be fixed by this: https://core.trac.wordpress.org/changeset/50366
This is a bug in WP core 5.6.1: https://core.trac.wordpress.org/ticket/52440 which will hopefully be fixed by this: https://core.trac.wordpress.org/changeset/50366
Welcome to WordPress SO. You may already have solved the issue as suggested by @Stevish, but just in order to avoid promoting the idea of checkboxes somehow being bad or difficult, I’d like to point out, that they’re perfectly okay and logical. 🙂 What is the problem in your first snippet, is the additional closing … Read more
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
If I understand you right, you’re looking for custom header support for custom post types. By default WordPress does not offer such a thing for custom post types. The features that are offered for CPTs are listed here: Arguments for register post type(). So this is not easily possible.
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
function my_portfolio_meta_box_cb($post) { $template = get_post_meta($post->ID, ‘_wp_page_template’, true); if ($template == ‘portfolio.php’) { add_meta_box(……..); } } Hook this via the register_meta_box_cb arg when registering the post type or in your manually via add_meta_boxes-portfolio hook.
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
It seems that it still exists, you just have to enable showing it, with screen options http://theandystratton.com/2011/wordpress-3-1-admin-bar-and-i-cant-see-custom-fields
you can do that with hooking a simple function to save_post hook add_action(‘save_post’,’my_rating_field’); function my_rating_field($post_id){ global $post; // verify if this is an auto save routine. // If it is our form has not been submitted, so we dont want to do anything if ( defined( ‘DOING_AUTOSAVE’ ) && DOING_AUTOSAVE ) return; // verify this … Read more
Try to wrap true with quotes <?php $event =array( ‘post_type’ => ‘Events’, ‘posts_per_page’ => 1, ‘meta_query’ => array( array( ‘key’ => ‘front_event’, ‘value’ => ‘true’ )) );?>