Popular Posts
All posts ordered by popularity
PHP securing email scripts
This tutorial describes several important strategies for securing contact forms and scripts that make use of PHP’s mail() functionality. If your script is sending email based on user input, these tips will help to keep things safe and secure.
Basic Code for Image Slider
Here is the basic code required for making a simple image slider. It provides a good starting point for rolling your own sliders, carousels, and so forth.
Replace contenteditable with textarea
Working on my WordPress plugin, Dashboard Widgets Suite, I needed a solid way of replacing contenteditable with a textarea on form submit. Here is a simple solution along with some bonus notes on dealing with certain HTML tags.
Add titles to previous_post_link & next_post_link
Here’s a quick way to include a title in previous_post_link() and next_post_link().
WordPress Create New User
Two ways to programmatically create new users in WordPress. The first method uses wp_create_user() and the second method uses wp_insert_user().
WordPress get all user emails
Quick snippet to get all user emails in WordPress.
WordPress.org Login URLs and User Profile Pages
Working as a developer at WordPress.org means that I get to log in and help people, update my plugins, and make sure my profile information is current. For quite awhile, however, I was confused about the various URLs that are involved with logging in and managing profiles, preferences, and so forth.. The whole WordPress.org domain […]
PHP List All Directory Files
Here are three ways to list all files in a directory via PHP: via iterator class, file function, and while loop (in order of preference).
WordPress check if plugin is active
Developing WordPress plugins, it’s super useful to know if another specific plugin is active. Fortunately WordPress makes it easy to do, read on to learn how..
Post format archives
The Post Format Archives Widget makes it easy to link to your custom-formatted posts. Here is a snippet for conditionally displaying their respective archives.
PHP Get Actual IP Address
Here are a couple of quick snippets to get the visitor’s actual IP address via PHP.
PHP check if file exists by URL
This quick PHP snippet can be used to check if a specific URL exists. I use this in one of my projects for checking the existence of a robots.txt file on the site. Can be modified to check for files on any publicly accessible site.