Create a class to handle updates Add this to your plugin’s main PHP file or a separate updater file: <?php class GitHub_Plugin_Updater { private $slug; […]
MYSQL: Check User Exists & Grant Privileges On Database
Check if the User Exists SELECT user, host FROM mysql.user WHERE user = ‘your_username’; If the user doesn’t exist, create them first: CREATE USER ‘your_username’@’%’ […]
WordPress: Plugin To Download Random Posts To A CSV File
The following code will create a plugin that allows you to download random posts based on selected categories in an admin page. 3 CVS files […]
WordPress: Spoiler In Post Content Function
The following code can be added to your WordPress functions.php file or added as a plugin to allow you to mark sections of your post […]
Tabbed Navigation With QueryString Open Tab Selection
The following code will create a series of tabbed sections on a single page. Each tabbed section will have a series of boxes that contain […]
Validate UK Postcode
The following script will take the input from the form and validate a post code in UK Format eg. Lettter Letter Number Number Letter Letter […]
RegEx To Replace Empty Tags with just IDs Using Notepad++
Here is an example html output from a DOCX file imported into WordPress (in this case with the Mammoth docx converter plugin): <h2><a id=”post-44034-_7ttglipb267h”></a>Header Text</h2> […]