Using the WordPress apply_filters Function for Dynamic Content
In a WordPress plugin you can filter many values including the title and content of a post using: add_filter('the_content', 'MyPluginClass::FilterTheContent'); This is pretty handy, but sometimes when you’re writing a WordPress theme you want to allow plugins to add content, not just filter the usual content. Using apply_filters makes this pretty easy because you can call apply [...]
WordPress and PHP have Poor Support for Dates and Time Zones
Today I spent way too much time figuring out how to convert dates and times to different time zones. PHP can barely do it, and WordPress really doesn’t do anything to make it easier. I would love it if someone would just create a simple function like this: $string = format_gmt_time_for_time_zone( 'l, F [...]
Swift Mailer: Awesome PHP Mailer
Tonight was the first time that I needed to write some code for a business that would send email to customers, or at least email that needed to be reliable and feature rich. I looked at the documentation for the PHP mail function and after a lot of reading realized it was not going to [...]
Using PHP Class Methods as WordPress Action Hook Callbacks
Using object oriented code is a must for me. Object oriented code is more than just organization of the code, it’s organization of one’s thinking. I wanted to talk about using static class methods as handlers for WordPress actions. This is important to me because often my plugins are implemented as a class. add_action('init', 'MyPlugin::Init'); class MyPlugin { [...]
WordPress Plugins and AJAX
The last couple of days I’ve been doing a ton of AJAX programming on some WordPress plugins. Wordpress actually does have one very handy AJAX feature that makes using AJAX just a little easier. I also use jQuery because it’s really nice for a lot of things including AJAX work. AJAX is a great technology, and [...]
OS X Automator Time Savers: Variables and Ignore Input
When you’re in the web business there are a lot of repetitive tasks, such as making image thumbnails, updating website code, or adding images to a blog post. You will do a better business if you can automate these tasks as much as possible. For me, creating automated methods is also more fun. I quickly [...]
Learning MySQL
I have plenty of experience with databases, but I haven’t been hands on for a while. Now I am hands on developing plugins for WordPress. It’s really fun for me. Today I needed to know the MySQL type to use for holding money or currency values: DECIMAL(10,2) There is surprisingly little discussion on this and what discussion exists [...]
Why is JavaScript so Lame?
OK, where do I start. I’m kind of exhausted. I’ve been doing so much totally intense WordPress PHP and JavaScript work over the last few days that my brain is mush. But at the same time, I’m so needing to conquer it that I can’t stop. I keep putting the computer away, then I get [...]
WordPress: Why Open Source is Great
Amazon: grep WordPress is a great example of why open source is important. When I’m working on something and I have a question about a WordPress API, I Google for what I need. What I usually find is either API documentation on the WordPress website, or a discussion on the WordPress [...]