How to automatically flush permalinks?

To automatically flush permalinks every hour, use the following code: Hook the scheduling function to init. Schedule an hourly event if not already scheduled. Hook the scheduled event to a function. Define the function to flush rewrite rules. // Hook the scheduling function add_action( ‘init’, ‘schedule_my_hourly_event’ ); // Schedule the event function schedule_my_hourly_event() { if … Read more

Building my first ever Gutenberg block

Gutenberg recently upgraded JSX Runtime which is only compatible WP >= 6.6. See link https://make.wordpress.org/core/2024/06/06/jsx-in-wordpress-6-6/ If you update WordPress to 6.6-beta2 then it should work. In the meantime they are figuring out about back compatibility. See comment – https://make.wordpress.org/core/2024/06/06/jsx-in-wordpress-6-6/#comment-46779 Or if you are not ready to upgrade to WP 6.6 yet, you can downgrade @wordpress/scripts … Read more

Is there a way to pull remotely generated XML, process it, and display it on a Managed WordPress page?

Step-by-Step Guide to Create a WordPress Plugin for Fetching and Displaying Remote XML Data 1. Create a New Plugin Directory Connect to your WordPress installation via FTP or use the file manager in your hosting control panel. Navigate to wp-content/plugins/. Create a new directory named remote-xml-fetch. 2. Create the Plugin File Inside the remote-xml-fetch directory, … Read more

How to allow Contributors to edit their own posts, whilst still needing to be reviewed by an admin?

Steps for setting edited posts by contributors to “pending review”: 1. Adjust Contributor Capabilities Your modifications to the contributor role are appropriate for allowing them to edit their posts. Ensure they can edit posts but cannot publish them. 2. Automatically Revert Posts to “Pending Review” on Edit Add the following code to your functions.php. This … Read more

$wpdb->update is not working until next page refresh. Is there one more step?

When you use $wpdb->update in WordPress, it updates the database immediately, but WordPress might still show cached data. To ensure the updated data is displayed right away, you should manually clear the post cache using clean_post_cache($pid); after the update. Here’s the adjusted code: $pid = 55276; $post = get_post($pid); echo ‘original post:<BR>’.$post->post_excerpt.'<HR>’; $newtext=”some textt2″; global … Read more

Recover old website domain

Most hosts would have deleted everything long ago. If you’re not paying for service, they will sell that server space to someone else. You should contact the host directly to ask. You can try looking in the Internet Archive – if it indexed your content while the site was live, it would still have the … Read more