2 - Use mysql2date  to convert date string obtained from the database into a readable date

Use mysql2date to convert date string obtained from the database into a readable date

Instruction: Parameter PARAMETER TYPE DESCRIPTION DEFAULT REQUIRED $format string Output can be PHP date format or Unix timestamp. no yes $date string mysql2date() only recognizes “Ymd H:i:s” format, so the original timestamp string needs to be converted to this format. no yes $translate boolean If true, the specified date and format string will be passed … Read more

gutenberg list all blocks - List all WordPress Blocks in the Editor

List all WordPress Blocks in the Editor

WordPress.com has a list of all the blocks that are available inside the Gutenberg editor, and for self-hosted WordPress websites you can run the following command in the browser console when using the editor to get a list of all available blocks. The output:

How to send AJAX requests in a WordPress theme or plugin - How to send AJAX requests in a WordPress theme or plugins

How to send AJAX requests in a WordPress theme or plugins

AJAX enables tasks such as fetching, inserting and deleting records from a MySQL database, as well as file uploading. AJAX sent URL should be admin-ajax.php. wp_ajax action hooks. Here are well-explained tutorials from Yogesh Singh on how to send AJAX requests from a WordPress theme and a WordPress plugin:

js css files wp plugins - How to setup JS and CSS environment files for WordPress plugin development

How to setup JS and CSS environment files for WordPress plugin development

I got the method I’ll describe below from Krasen Slavov, who shared it on his blog wprotary.com back in December ’21, and I’ve been using it for my WordPress plugins ever since. If you require anything more complicated with eslint, stylelint, and PHP standards, I recommend using Composer + nodeJS, or looking into Gulp. Requirements … Read more

Cache REST API responses and speed up WP REST API requests - Cache REST API responses and speed up WordPress REST API requests

Cache REST API responses and speed up WordPress REST API requests

When using WordPress REST API each request is processed by WordPress and depending on the size of the database and server performance, issues start occurring for high-traffic websites. By using a plugin such as WP REST Cache you can cache the responses of the REST API, making it much faster. Then if you want to … Read more

Remove cronjobs from AnonymousFox malware - 🔴 FoxAuto WordPress malware

🔴 FoxAuto WordPress malware

The AnonymousFox Hack guide by Sucuri misses a huge step in cleaning a hacked WordPress website, and that step is: removing the cronjobs While removing AnonymousFox malware from a website I noticed the following cron: It downloads a script from http://hello.hahaha666.xyz/xxxd and runs it, the script is: It creates a new folder css and replaces … Read more

How to create a Custom Single Post Template - 💡 How to create a Custom WordPress Single Post Template

💡 How to create a Custom WordPress Single Post Template

Before we get to the technical stuff, I highly recommend creating a Child theme first prior to any changes. Step 1. Open up your theme’s folder and copy single.php file to something different like awesome-custom-template.php That’s it! Congrats, you’ve just created your very first custom WordPress single post template, now it’s time to modify it as you … Read more