Delete post meta front end

For anyone else looking for guidance on how to do this, I created another custom field called event_status and by using the save_post action in wordpress set a condition that once this changes to then the run delete_post_meta action as follows: function event_status_is_updated($post_id){ if(get_post_meta($post_id,’event_status’,true)==’not_complete’){ delete_post_meta($post_id,’date_dun’); } } add_action(‘save_post_event’,’event_status_is_updated’);

Help with customising love it plugin (use within foreach)

A couple of problems- setup_postdata doesn’t work with any variable other than $post, so that line is doing nothing. This is explained on the Codex page for setup_postdata. get_the_ID doesn’t accept any arguments, but it doesn’t matter, you’ve already got the ID in $event->ID, just change all instances of get_the_ID($event->ID) to $event->ID.

Clone the “proceed to cart” button and place it above checkout on the cart page, but only appear display size is 320px

Just call woocommerce proceed-to-checkout-button template in woocommerce_before_cart action hook as follows- add_action(‘woocommerce_before_cart’, ‘add_wc_button_proceed_to_checkout’); function add_wc_button_proceed_to_checkout(){ echo ‘<div class=”wc-proceed-to-checkout”>’; wc_get_template( ‘cart/proceed-to-checkout-button.php’ ); echo ‘</div>’; }

WordPress file upload

WordPress has it’s own way of handling file uploads, so it’s best to follow their lead on that. It does do some file validation, but if you want to be restrictive with MIME types I’d keep the code you originally have, Here’s the code that can replace your second block though to actually upload the … Read more