Category Archives: WordPress

WordPress Escape Functions

The process of escaping data an important one, since the lack of thereof can lead to XSS and other naughty and unexpected things, among the legit data that just breaks specific data formats.

WordPress Escape Functions

Consider HTML attributes. Imagine you have the following simple code:

$image_src = get_uploaded_image_src(); // not any specific function
echo '<img src="' . $image_src . '" />';

What if the uploaded image is called “Horizons” by LTJ Bukem.jpg? You end up with broken HTML: <img src=""Horizons" by LTJ Bukem.jpg" />… not to worry though, WordPress comes a dozen escape functions for taking care of all these sorts of things. However, with the myriad of escaping functions provided in WordPress, it is often times difficult to remember which is which and whether there is an escape function for a specific case.

Continue reading



Tiny Projects Inspired by WordPress

WordPress development has inspired core developers to code up some interesting utilities, tools and toolchains to aid in the deployment and development processes. Like the notorious `bumpbot` (compresses scripts and styles, bumps their version numbers) and `potbot` (generates pot files), there other at least a dozen other tools that are not only useful, but open-source and available for download.

Tiny Projects Inspired By WordPress

Ready to look into some of the most interesting ones?

Continue reading



WordPress trunk news #5

Last week’s edition of WordPress trunk news provided an overview of some of the major happenings in the very exciting Project Gandalf and the WordPress Theme API.

WordPress Trunk News #5

Here’s what happened in the WordPress trunk this past weekend and this week.

Continue reading



Random New User Password Generator for WordPress

Inspired by https://wordpress.org/extend/ideas/topic/random-password-for-new-users WordPress plugin idea, and a bit of time on my hands, I decided to code up a simple little plugin that is easy to understand and use.

Random User Passwords In WordPress

Meet the Random New User Passwords for WordPress plugin. It’s a minimum viable solution, with zero-configuration, so don’t expect much.

Continue reading



List All Posts In WordPress Navigation Menu

You may remember that last week, I’ve been dabbling in the world or WordPress navigation manus hacking around and looking into how to get dynamic Custom Post Type Archives in WordPress Menus.

I got directed towards a related and highly interesting question by @topher1kenobe. Couldn’t stop thinking about an easy and viable solution, so decided to go ahead and code it up.

List All Posts In Nav Menus WordPress

I know WordPress can automatically add pages to a custom menu, but can we have one where it’ll automatically add posts from a custom content type?

Continue reading



Generate WordPress Posts From Fan Mail

Whenever I dig around the WordPress source code, I try to come up with crazy functionality ideas and scenarios that at least one person in the world might find useful, write them down and come back to them and write some code whenever I feel like relaxing and having a bit of fun. Today is one of those days.

Generate WordPress Posts From Reader Fanmail

In one of my last week’s posts titled Another 7 Overlooked WordPress Helper Functions, I mentioned the POP3 library that is bundled with WordPress as something one can use.

Useful for all sorts of interesting things, like parsing reader fan mail to draft posts automatically, answering them and publishing them.

Continue reading



WordPress trunk news #4

Compared to last week’s changesets, this week has seen a little more exciting action throughout the trunk. Moreover, a 20000-commit milestone has been reached this week.

WordPress Trunk News 4

Continue reading



Custom Post Type Archives In WordPress Menus!

You may have read about the Custom Post Type Archives In WordPress Menus dilemma that I brushed over quickly yesterday. Today, after a bit of sleep, I’m ready to publish some concept code that adds Custom Post Type archives to the WordPress-powered menus. It’s going to get dirty, you’ve been warned.

Custom Post Type Archives in WordPress Menus

Continue reading



Custom Post Type Archives in WordPress Menus?

I was setting up a development WordPress environment under a non-root directory on a remote server this morning. Created a couple of custom post types and, as usual, was about to create separate pages for them (more on the technique later). This usually works out quite well, however, I decided to take another well-known route – use their existing archive pages via their slugs. Went over to the Menu and, obviously, found no Custom Post Type archive metabox that I could create a Menu item from. Custom Post Type posts – sure. Custom Taxonomies? Yes, Sir. Custom Post Type archives? …

WordPress Custom Post Type Archives in Menu

And, of course, I couldn’t take the thought off my mind all day (probably won’t sleep tonight figuring out). How does one set up a proper archive page menu item? There are, generally, two approaches to this (+1 hackish one). If you know of more, do share, please.

Continue reading



20,000 WordPress Commits

From b2/cafelog fork to full-scale CMS giant, powering over 60% (and rising) of the top million websites (according to BuiltWith), WordPress has been there for us for almost 9 years now; from those of you who got to download the first 0.70 version and those, who are downloading WordPress today (version 3.3.1) for the first time ever.

20000 Commits in WordPress

Continue reading