Problem with Date translation in WordPress

So to see how that date_i18n function works you can search for it, then hopefully find the documentation. That’s here: https://developer.wordpress.org/reference/functions/date_i18n/ It’s technical to read it, but what it says is that the first parameter on the function is not the date you want to translate but the date format that you want the date … Read more

How to move a post from one category to another

add_action(‘wpcf7_mail_sent’, function ($cf7) { $submission = WPCF7_Submission::get_instance(); $data = $submission->get_posted_data(); if( empty($data[‘_wpcf7_container_post’]) ) return; $post_id = (int) $data[‘_wpcf7_container_post’]; wp_remove_object_terms( $post_id, ‘available’, ‘category’); wp_set_object_terms( $post_id, ‘booked’, ‘category’); });

WP_QUERY post_in problem

As documented, it’s post__in, with two underscores: $paramss = array( ‘post__in’ => array( 760, 761 ) , ‘post_type’ => ‘product’ );

Non-blocking file_put_contents in function.php

Instead of contacting the remote site to get the information in an expensive HTTP request, why not have the remote site send you the data at regular intervals? Register a REST API endpoint to recieve the data on In that endpoint, take in the data and save it in all.json On the remote site add … Read more