Bypass fetch_feed cache

SimplePie does not necessarily use the exact feed URL that was passed to fetch_feed() – see SimplePie::get_cache_filename(), but yes, WordPress adds the feed_ prefix to the transient key. So you can instead try using the wp_feed_options hook to get the correct transient key and then delete the existing transient. $bypass = $this->bypass; add_action( ‘wp_feed_options’, function … Read more

copy wp-include/link-template to child theme

The article you linked to already has a solution written by the co-founder of WordPress Mike Little: https://digwp.com/2012/05/post-navigation-author-category/#comment-36899 In the spirit of constructive criticism, the correct solution to this is in two parts: Firstly, the third parameter to previous_post_link() and next_post_link() is a flag to say keep the same category. Modify your theme (probably in … Read more

Media manager asks for file title when upload

Line 4139 of post.php in WP 6.2 branch has the error message, Content, title, and excerpt are empty.. Reviewing the previous lines of code, it should be excluded for attachments, but there may be a callback applied to the wp_insert_post_empty_content filter which is requiring attachments to also have content, title, and excerpt. Use Query Monitor … Read more

Custom fields in the billing address section woocommerce

I have run into these issues before myself. I am not entirely sure it’s possible to get adjust the billing address box directly unless you adjust the actual email template for the emails. Specifically, if you have access to the file structure, look in the “/wp-content/plugins/woocommerce/templates/emails” folder of the WooCommerce Plugin. They are made to … Read more

Is there a way to assign a default Category to a Post when the user creates a new Post?

WordPress presents default category as a setting in Settings -> Writing (though this doesn’t seem to pre-check the checkbox): The new_to_auto-draft action will allow you to do things to a new post before the page loads, and does pre-check the checkbox (tested): add_action( ‘new_to_auto-draft’, static function ( $post ) { $default_category_id = 25; // The … Read more

WordPress custom Block showing error in Posts editor but working in Pages editor

This should work: <?php if ( is_user_logged_in() ) { echo “This isn’t editable in here”; } else { include get_template_directory() . ‘/template-parts/blocks/form/from/functions.php’; if ( ! isset( $_POST[‘firstFormDisplayed’] ) ) { // we haven’t yet displayed the form asking for numbers, so do that now. displayFirstForm(); } else { // we’ve got the numbers, but not … Read more