Create a temporal post
Create a temporal post
Create a temporal post
Your check is incorrect: right now, it tries to access $_POST[‘rating’], which might not be set, and then checks whether that value is empty. Furthermore, you should scope your if statement with brackets, because right now, your code will try and update the average rating even if no new rating is provided. Try: function save_comment_meta_rating( … Read more
At the top of the Gallery Shortcode Callback is a filter hook: post_gallery If any non-empty / non-null output is returned from this filter the shortcode will use that output instead of the default generation. You can copy the source of the Gallery Shortcode Callabck and modify it as you see fit. The below is … Read more
Display attached images of a page or post that are insetred using gallery
Assuming your $hasp_expire_date = get_post_meta( $post_id, ‘hasp_expire_date’, true ); is giving you the correct value you need, you are storing your that in the $hasp_expire_date variable. So edit that second line to: $num_comments = get_comments_number( $block_data[‘id’] ); // Pull in the value you need $hasp_expire_date = get_post_meta( $post_id, ‘hasp_expire_date’, true ); // You are going … Read more
delete functionality wordpress
How to get a post’s attached media (audio) ID and insert it into rtmedia shortcode
Using a PHP form, get the page title or any other element in the sent e-mail
Editing the custom field itself would be the easiest way. In the field, under “Return Format,” you can change it from Post Object to Post ID. That way, when you call for the data, you’ll already have an array of just the IDs. If you’re not able to change the field for some reason, you … Read more
I figured it out. woocommerce_payment_succesful_result guided me in the right direction, although it wasn’t the final answer. function is_wc_endpoint_url() is really useful here, it checks where woocommerce is about to redirect next. // redirect empty checkouts and completed orders. add_action( ‘template_redirect’, ‘myfunction’ ); function myfunction() { if( is_wc_endpoint_url( ‘order-received’ ) && isset( $_GET[‘key’] ) ) … Read more