Author Archives: soulseekah

PHP 5.4 – A Week In

It’s been a week since I switched over to PHP 5.4 and here’s what I can say, even though I haven’t had much time to use the new features I was looking forward to.

PHP 5.4

First of all, you won’t find PHP in your distribution repositories, it’s too early. Grab the source and compile.

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



Ready-to-paste HTML-escaped Code in Vim

I’ve seen countless of websites that paste code and do not escape the <, > and & characters, resulting in broken HTML and missing code. I have been using online HTML entity encoders when pasting code, but today I decided to code a little Vimscript for my Vim.

Escape HTML Entities in VIM

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



VIM Scripting with Python: Lookup IP Country

I’ve been playing around with VIM scripting today, experimenting with a very small and limited portion of VIM’s full capacity. VIM scripting is powerful, however one is able to leverage the power of built-in and external Python libraries instead. Imagine coding an XML library in VIM script, it’s time consuming and error-prone. To make the article a little more fun, I’ll code up a simple VIM script that looks up a country for an IP.

VIM IP Lookup in Python

This mini-tutorial assumes you know the basics of VIM – movement, modes, buffers, windows, etc. I’m also going to assume that you’re using a terminal version of VIM.

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