We’ve all done this by accident. Why? Because it’s intuitive! It’s a developer API that makes total sense when passing through simple values. Well, like it or not, WordPress wants a callback function – always.
Alright, so I thought I’d experiment a little with the callStatic magic method in PHP and see if I could create a pattern to expand on the helper functions that are already in WordPress for the sole purpose of being used as filter callbacks.
And if you didn’t know about those yet, well, you’re welcome:
In the end, I don’t think my magical class is very practical, but it was still a fun experiment. I especially think the method for doing indexed array output was clever, though real-world application for that is probably pretty rare. Ha! Go figure.
This latest product is a continuation on my streak of other plugin releases that also deal with the topic of user session security.
The idea here is pretty simple.
If you have registrations open on your WordPress site, chances are there is a decently-sized group of users that have simply gone MIA. They have accounts, and they might come back later, but you’re just not sure when that will be.
The fact of the matter is, the more active login accounts you have on your site, the more potential opportunities there are for break-ins. And once a hacker is authenticated inside WordPress with the right kind of capabilities, the more opportunities there are to do some real damage.
Whenever I take an extended vacation I always bring along the Apple TV.
At the end of a long day filled with adventure and fun it’s nice to unwind with your favorite show on Netflix or rent a new release comedy.
I’ve found that hotel television is still so primitive and annoying. The on-demand movie rentals are limited and very pricey, the regular programming is usually in standard definition, and you’re forced to channel surf without a guide. Ain’t nobody got time for that!
When I book a hotel I always make sure there is free Wi-Fi and that they say there are “flat screens” in every room, this tells me that there must be an HDMI input on it somewhere.
It seems we’re left with no choice but to do some friendly hacking to circumvent this annoying speed bump! 🙂
For the past 7 years I’ve been building websites, themes and plugins for WordPress. It’s really fun, and I love it.
But there are some avenues that I have yet to explore. The biggest one is building a web application using WordPress.
I’m happily employed over at X-Team working full-time on Stream, so I’m really just looking to create another passive income stream for my family. This is not urgent in any way, and if I’m being totally honest with myself, I’m probably just looking to scratch the proverbial entrepreneurial itch I have after selling a business I was running on the side last month.
If I’m going to start a new project, and there is not a strict time table, why not try something new? It will give me a chance to learn some new technologies I’ve not used before, like Backbone.js, and build something that I think is cool.
Three years ago, in July 2011, I started a theme shop. It was an era where many people in smaller niches were yet to be discovered by developers as a force to be reckoned with. The “The Long Tail” principal hadn’t yet sunk in, at least not enough for churches to have viable WordPress theme options available to them.
Churches were being grossly under-served in every WordPress theme marketplace. The most common option for them was to customize their favorite “photography” or “design agency” theme, somehow seeing past page after page of irrelevant stock imagery and the thousands of “shortcodes” they wouldn’t be using. Sprinkle in a few plugins, and say a prayer – maybe, just maybe, this would work.
We all know you can use wp_get_attachment_url() to return an attachment’s URL by passing in the ID, but what about the reverse scenario?
There are a lot of long-winded examples of how to get an attachment ID by URL floating around the interwebs. Most of them limit results to only returning images or use expensive DB queries. Really, there should be a function for this in core, but there isn’t.
Needless to say, I wasn’t really happy with any of the solutions I found people using, so I decided to take a stab at it.
Below is the most lightweight method I’ve come up with (so far) to get an attachment ID by passing through an attachment URL.
Just as an example, this would echo the attachment ID integer of test-image.jpg onto the page: