Posted by & filed under Random.

Yesterday was one of the stops for our official start to summer – picking up the small, inflatable pool that our daughter is going to be in for most of the next few months. Normally we just get one of the $20 inflatables that are big enough for her to sit and jump around in, but the one to the right caught our attention. For $45 at HEB we got one that’s about 2.5 feet deep and 10 feet in diameter.

It’s a Bestway, which probably isn’t the best brand. But it’s working so far. It’s short enough that it doesn’t need external bracing. The inflatable ring on top is enough to keep it together. Although I’m going off of what the box says since we’ve only had it up a little over 24 hours.

And while on the topic of time, the 10 minute setup time that’s on the box is way over optimistic. 10 minutes might be right for getting it together, but filling a 900 gallon pool with a water hose takes a long time. It’s one of those things I expected going in, but was really hard to explain to my daughter.

Overall though, for about 50 bucks an above ground pool this size with a filter was too much of a deal to pass up, even if it doesn’t hold up more than one summer.

Oddly, Amazon has the same pool for $130, so if you’re near an HEB that might be a better bet.

Posted by & filed under WordPress.

An unidentified error has occurred trying to list tags

Working on a plugin today, part of which includes a custom taxonomy, and came across a snag today.

Got the taxonomy added, along with the custom post type it was associated with. The meta box showed up just like it should. And I could type in items for the custom taxonomy and have them stick.

The snag was when I tried to type one in. The dropdown for auto complete would only show a 0. And clicking on the most used tags link would show “An unidentified error has occurred.”

Since this was the first time I’ve done anything with custom taxonomies, I was trying to make the fix way harder than it was.

The solution wound up being very easy. I just changed the priority on the add_action call that added my callback to admin_init to a lower number and it fixed it.

Posted by & filed under Programming.

Normally I just don’t worry about this since I’m usually building websites and HTML takes care of merging multiple spaces. But it comes up occasionally. And since it’s just a quick regex replace, it’s pretty quick to merge multiple spaces.

$x = preg_replace('/\s{2,}/m', ' ', "This     string   has     spaces");

Piece of cake.

It looks for any places that there is 2 or more spaces and replaces it with a single space.

Posted by & filed under Blogging, Programming.

Sitting here working on setting up a WordPress network and hit a snag. New sites have a giant “Welcome to your new WordPress site” message when someone logs in for the first time.

Now, I’m not against the message; and WordPress should definitely market where ever they can. But I’d like to be able to customize the layout a bit. Still plan on keeping links to WP and all of that, just want to add in some of my own welcome message.

Googling didn’t turn up anything except editing the core WordPress code which is a terrible idea. I don’t want to have to redo it every time WP upgrades. And it looks like there isn’t a hook or filter that can make it easy. So I had to make it ugly. Read more »

Posted by & filed under WordPress.

Had a thought while scrolling to the bottom of a WordPress post with 250+ comments. Does having the add new comment form at the bottom of a page that long lead to fewer comments? Really, who is going to scroll that far?

So I’m going to play around a bit here and move the comments form above existing comments. Guess we’ll see what happens.

And if you’ve tried the same thing and it worked, or didn’t, let me know.

Posted by & filed under Programming.

Sometimes I try and make things way too hard.

One of the things that a web app I’m working on needs is the ability to do an advanced search. It’s using the outstanding DataTables plugin for jQuery which takes care of most of the work. But the way I wanted to have the advanced search work is to repopulate the search field with a formatted string like “fieldOne:some info::fieldTwo:some more info” and so on for each of the 6 possible data elements.

That was pretty easy. Attached an onClick event handler to the search label to pop up a jQuery dialog which would then fill in the input field when one of the buttons was pressed.

Refreshing the table is where I hit a wall. Looking through the DataTables forum I found all kinds of posts on using fnDraw or a plugin called fnRefreshAjax that would supposedly work, but none did.

Then it clicked. DataTables was already doing what I needed to do when a keyup event fired. All I had to do was call the keyup event on the input field and it would take care of it for me.

A few hours later, and this little bit of code solved my issue.

$('div.dataTables_filter input').keyup();

One line, instead of about 20, and everything was working just like it should.

Posted by & filed under Programming.

Ajax file loaded in Google developer toolbox. A double click and it opens in the browser.

How did I not know this already?

I’m working on a web app that’s pretty Ajax heavy so I’ve got the Chrome developer tools window opened up to the Network tab so I can see what’s going on. By accident I double clicked on one of the files and it pulled it up in the main web browser.