Occasionally a plugin or theme will need to display a notice to users in the WordPress dashboard. This is fairly easy to do using the admin_notices hook, which shows a standard message box at the top of the screen.
Options Framework: Sanitization Filters
I’ve been steadily improving the Options Framework plugin these last couple weeks. The biggest new features are sanitization filters and better validation…
Checkboxes and Booleans
A little tutorial on boolean basics. The string “false” returns true, and other fun facts.
Set a Cookie in WordPress
Sometimes you want to detect new users on your site versus returning visitors and display different sorts of information to them. An easy way to do this is to set a cookie.
Adding and Removing Tags on GitHub
If you’ve accidentally committed a tag and pushed it up to GitHub, it’s quite easy to delete it and then add a new one. For this example, I’m deleting my previous tag “v1.0”, and then adding a new one for the repo at its current state.
1) Delete the v1.0 tag locally:
git tag -d v1.0
2) Delete the v1.0 tag on GitHub (which removes its download link):
git push origin :v1.0
3) Add a new tag for the updated release:
git tag -a v1.0 -m "Version 1.0 Stable"
4) Push the latest tag to GitHub (two dashes):
git push --tags
Javascript Race Conditions
I’ve encountered a couple issues with javascript race conditions this last week. Here’s a fix you can use.
Code Snippet: Get WordPress Version
Code snippet for checking which version of WordPress the user is running.
More Tags or Excerpts
What’s the difference between the_content and the_excerpt. What if you want to use the more tag, but strip out images and objects? Big questions. Answered here.