Tag Archives: plugins

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

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

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

What `the_content` goes through

the_content is one of the most known WordPress template tags. It wraps itself around the get_the_content tag (a little lower in the source) and applies the the_content filter to it.

the_content filters in WordPress

the_content filter applies at least 10 default filter functions to the content before displaying it. WordPress post content is usually just altered here and there, not too drastically (except shortcodes, of course), and sometimes you just have to know what to expect when displaying filtered content.

Continue reading