theme hooks

You are currently browsing articles tagged theme hooks.

Just a quick note to say that I’ve finally got the Writing Plugins for Tarski documentation page in a usable state.

January 9, 2008 by Ben Eastaugh | Permalink

2.0.5 Release

Tarski 2.0.5 was initially slated as a pure bugfix release, but as with most things, it grew in the making. Details are in the changelog.

Download Tarski 2.0.5

However, the most major features are the bugs fixed. To begin with, the navbar now reorders correctly, and no longer needs to save that order when pages are saved; more efficient and better-written code makes it all happen dynamically.

A problem with Tarski’s options saving and updating code was exposed by the new multiple authors checking instituted in 2.0.3, with the result that the save-and-restore no longer worked properly: restoring one’s options after deleting them would merely save the defaults to the database. The underlying issues have now been fixed.

On the new features front is one I know I’ll appreciate as I continue to improve Tarski: the code behind the version check is now a lot smarter. It used to just check whether the version grabbed from the stylesheet and the one in the database—now it can tell whether any given version is newer or older than the installed version, which lets us do things like show a notice on the Dashboard notifying the user that they’re using a development version.

Lastly, I appropriated some WordPress widget code to rewrite the recent articles section, with the result that it’s now added via an action hook, th_fmain, and can consequently be removed by a plugin as well as through the Options page. The recent articles’ excerpts also have WordPress’ excerpt filters applied to them too, so any plugin which adds or removes those filters will now work as expected on Tarski’s excerpts.

Enjoy the new version; all being well, it’ll be the last before Tarski 2.1, but I wouldn’t bet my life on it.

Please post bugs and suggestions on the forum.

Tags: , , , , , , , ,

2.0.1 Release

With any major Tarski release, I know that there are bugs which won’t rear their ugly heads until it’s in the wild. Tarski 2.0.1 fixes the ones that have shown themselves so far. Details are in the changelog.

Jordan is the man to thank for the major fixes: he’s written a new, more efficient feed parser for the update notifier that should eliminate the memory limitation issues a couple of people had, and added an increased level of robustness to the options updater.

There are also fixes for a couple of CSS bugs, one where the navbar would disappear when only title and tagline were set to not display, and another where the next/previous post navigation disappeared in Internet Explorer.

Lastly, Tarski’s stylesheets are now added via the wp_head hook, and they can now be filtered. This means if you want to replace the stylesheets entirely, and just use the markup skeleton, you can do it without editing header.php. You could also use it to, for example, add per-page stylesheets or change the URLs to point to a separate file server.

Bugs, suggestions etc. to the forum as always.

Tags: , , , , , , , , , ,

2.0 Release

Tarski’s development reflects my own view of best practice: steady, incremental improvement rather than the occasional total rewrite. Sometimes, however, a small revolution is needed, and Tarski 2 provides one.

The new version includes a raft of changes. Taking a look under the hood one might be tempted to say that it’s an entirely new theme, but the experience should remain largely the same, both for admins and users.

Tarski’s options code has been rewritten from the ground up, making all sorts of new features possible. You can now select different widgets for posts and pages than are displayed on the rest of the site. It’s also possible to delete Tarski’s options entirely; however, they’ll remain in the database for another two hours, so if you delete your options by accident, you’ll be able to restore them within that window.

People shouldn’t have to learn PHP in order to use WordPress, or Tarski, but until now a modicum of technical know-how was required in order to add links (other than WordPress pages) to Tarski’s navbar. Now you can simply designate one of your blogroll links categories, and all the links in that category will be appended to your Tarski navbar.

Several people in the forum wanted tags to display everywhere, not just on single post pages, so we’ve added an option for that to the Tarski Options pages. The same goes for reversing the order of the title: now you can have the title of a post appear before the name of your site, just by ticking a box on the Options page. Finally, you can choose to link to either Atom or RSS feeds.

WordPress has automatically generated both types for quite a while now, but Tarski hasn’t linked to them—an oversight I’m very happy to have corrected. In addition to the site feed, the following page types now have automatically generated feed link elements in the document head: category archives; tag archives; day, month and year archives; and finally, searches.

Another request was for Microformat support. A couple of things made it into Tarski 1.6, but Tarski 2 brings hCard to posts and comments, and hAtom to posts.

Tagging also gets a boost with proper support for tag intersections and unions. Templating functions for this kind of thing aren’t even in the WordPress core yet, and it’s nice to be ahead of the curve for once. To see it in action, go and have a look at what’s tagged with bugs or features, or bugs and features. Before Tarski 2, all you’d get is the first tag’s name in the title. Now the title lists all the tags, and whether it’s an intersection (and) or a union (or).

With all the rewritten code comes a new structure: the files in Tarski’s library directory have been completely reorganised. Included code libraries (right now, just the Feedparser library which does the heavy lifting for Tarski’s version checking mechanism) go into library/includes, while PHP classes (and supplementary functions) go into library/classes (right now it’s just the Version and Options classes).

All Tarski’s CSS files, apart from style.css and the alternate styles, go into library/css, while JavaScript files are in library/js. Finally, Tarski’s large functions library has ended up in library/helpers. This new structure makes development easier, since it’s easier for me to remember where everything is, and it cleans up a lot of horrible, messy code that had been hanging around (in many cases) since the first release of Tarski, back in March 2006.

We’ve come quite a way since then, and I’d just like to take a moment to thank everyone who’s helped along the way. People who’ve suggested ideas and reported bugs in the forum; people who’ve helped test Tarski; people who’ve provided code, or artwork, or a critical eye. Jordan Liggitt in particular deserves a lot of gratitude for his hard work on this release. He’s helped make Tarski easier to translate; written a migration routine to carry your options over into the new system; caught various bugs in the new code; and contributed a number of thoughtful suggestions on safeguarding against CSS namespace corruption and improving Tarski’s sidebar options.

Again, thanks to everyone who’s contributed to Tarski in some way, and I hope you enjoy using the new version.

Bugs and suggestions should be posted, as always, on the forum.

Tags: , , , , , , , ,

For your delectation: the Tarski hooks reference. Some of this stuff isn’t in the current release, but since 1.7 is out soon I just wrote it with that in mind.

September 10, 2007 by Ben Eastaugh | 1 comment

As of Tarski 1.7, we will be removing the existing plugin integration from Tarski. This includes support for Subscribe to Comments, Gravatars and Ultimate Tag Warrior. What I hope to cover here is why we’re doing this, and how to successfully integrate Tarski with the plugins you want to use—whatever they happen to do.

WordPress’ plugin landscape is constantly changing: new plugins are released, older ones are abandoned by their creators. Functionality previously provided by plugins has been brought into the WordPress core code: first widgets, and in the upcoming 2.3 release, tags. Plugins relying on underlying third-party services like Gravatars and OpenID also change as these services run into problems or simply evolve in terms of their API.

This life-cycle is fairly normal, but our existing support for specific plugins in Tarski simply doesn’t acknowledge this reality. There are quite obviously too many plugins for us to support them all, or even a significant number of them. We’d also rather spend our time improving Tarski, rather than maintaining support for specific pieces of third-party code.

I say ’specific’ because what Tarski needs—and, in its theme hooks system, now has—is a generic way for plugin authors and users to make their code work with Tarski. It’s in need of better documentation, but it’s there, and it works; several times a week I offer advice to people on the forum as to how they can integrate their choice of plugin with Tarski.

Since the theme hooks system appeared in 1.5 we’ve been in a transition period, phasing out older ways of personalising Tarski installations (like the constants file). The next step is removing support for specific third-party plugins entirely, and that’s what we’re doing in Tarski 1.7. What follows is a rundown of the plugins, previously integrated with Tarski, that are having this support removed, and how you can add that functionality back in.

Widgets

WordPress Widgets are, as of WordPress 2.2, in the core WP code. As such, they’re still supported by Tarski, both in the sidebar and the footer. You can activate a widget-powered sidebar on the Tarski Options page.

OpenID

The extent of our OpenID support consists in testing a couple of plugins with Tarski and rewriting ugly OpenID URLs, so the status of this one doesn’t change: it works with Tarski, and should continue to do so.

Brian’s Latest Comments

The functionality offered by Brian’s Latest Comments plugin is now available in WordPress as a widget. Consequently, we’re simply removing the support for this altogether—if you want to carry on using it, use the widget.

Gravatars

Gravatar had some well-publicised problems, but is now back with a rejuvenated service. You can add Gravatars to Tarski (or any other theme, for that matter) by writing a plugin to buffer the Gravatar plugin function, extract the info, and add it into the comment content by adding a filter to the comment_text hook. The Using Gravatars page on the Codex has more.

Subscribe to Comments

The popular Subscribe to Comments plugin actually adds itself, if you upgrade to the latest version (which, of course, I recommend).

Live Comment Preview

Previewing comments is a feature I wish WordPress came with; Live Comment Preview is a JavaScript-powered halfway house towards fully-fledged preview functionality. It gets added automatically by the plugin, so the loss of integration isn’t a problem.

Clean Archives

The SRG Clean Archives plugin has long been part of our Archives template. No longer. However, I’ve made a Clean Archives template available for those who want this functionality. Just drop it into your Tarski directory and change its extension to .php, then select it as the template for your archives page as usual. I personally prefer version 2.2 of this plugin to the more recent, overly complex JavaScript-powered confection it seems to have become, but fortunately the plugin author has kept the older version available, and that’s what we’re still using. (Sean has responded in the comments.)

Ultimate Tag Warrior

Ultimate Tag Warrior is probably the highest-profile of the casualties. As of WordPress 2.3, tags are available in the WordPress core, and consequently Christine is discontinuing the plugin. Tarski 1.7 supports the new WordPress tags and removes all UTW-dependent code. There’s no going back on this one, I’m afraid, although for those on a nostalgia kick we will be maintaining the WordPress 1.6 branch for the time being, which retains UTW support.

Tags: , , , , , , , , , , ,

1.5 Release

Those of you who’ve been following our updates via Subversion will know this already, but for traditionalists who like to download a zip file each time, here’s Tarski 1.5. Quite a lot of stuff in the changelog, but I’ll give the usual rundown here as well.

First up is a rudimentary mobile stylesheet; something I’ve been meaning to add for ages but only recently got round to. It’s not amazing, but it’s functional and preserves the Tarski aesthetic.

The theme hooks system has been massively overhauled, with the clunky and simplistic constants.php replaced by the custom plugin hooks system I described recently. Check out library/tarski-hooks.php for the hooks, and library/constants-hooks.php for the bridge between that and the existing constants.php file, which is still supported as a legacy system (and a simpler one for the less PHP-savvy amongst us).

Amongst the other new features are better OpenID comments support, and thanks to one user’s intervention there’s also much better support for static front pages—which just goes to show, if you bring an issue up in the forum there’s a decent chance something will be done about it.

Other than that, there are the usual tweaks and bug fixes. Thanks as always to those who’ve contributed translations, suggestions, and code, especially to Jordan Liggitt who solved a problem with the older and newer entries navigation.

A quick note on translations: translations for Tarski 1.4 have been frozen here, translations for 1.5 will be added to the translations directory as they come in. The .pot file in that directory is up-to-date.

Bug reports, suggestions and translations to the forum please.

Tags: , , , , , ,

Just published an article over on Extralogical about adding custom hooks to WordPress themes, which might be of interest to the theme authors amongst you. It also offers a little preview of how the new hooks system in Tarski 1.5 will work.

June 13, 2007 by Ben Eastaugh | Permalink

1.2.2 Release

Tarski 1.2.2 contains numerous bug fixes and tweaks to improve both Tarski’s stability and its flexibility.

The changelog has all the gory details, but here’s a brief run-down of the changes. Firstly, our wonderful translation team has expanded the scope of the Swedish, Dutch and German translations currently available to cover the Tarski Options page and a few other bits of text which were missed or omitted (by me, not them) during the initial localisation work.

As always we discovered our own needs exceeded what the software was capable of, so we’ve added several more theme hooks to allow the insertion of text or objects (adverts, for example) at the end of posts and pages, as well as the ability for you to write custom 404 error messages. Instead of just linking back to your front page you could link visitors to your archives or tag page, or include a search field.

This release should also be compatible with WordPress 2.1: we’ve updated various things like links listings and the navbar code to make them work with the new functions and database schema present in 2.1. If you find any incompatibilities between this release and WordPress 2.1, or that we’ve broken anything in WP 2.0.x, please let us know so we can get a patch out quickly!

Lastly, we’ve fixed a number of bugs and tidied up the code in various places. A number of little scripts have been made into functions and can now be found in functions.php, which leaves the markup skeleton a lot tidier and easier to read and amend.

Many thanks to all our contributors, especially our tireless translation team, and I hope you enjoy using Tarski 1.2.2.

Please post any bugs or suggestions on the forum.

Tags: , , , , , , , , , , ,

1.2 Release

After however months it’s been since our last release, Tarski 1.2 is finally here. Here’s the changelog, which gives details on the various fixes, tweaks and new features.

Since most people won’t want to trudge through the changelog, here’s a brief list of some of the major things we’ve added, many of them after user requests.

There are now links to next and previous entries in individual archive pages, so people can navigate from entry to entry. There’s also pagination support for posts and pages, so you can make multiple-page posts and pages.

Also included is the pagination of index pages (like category and date archives, the front page, and so on). This is completely optional: you can enable or disable it at will from the Tarski Options page.

There’s some under-the-hood stuff, like better trackback and language support (so that people can do translations: more on this later). We’ve also added more theme hooks, and done default styling for a number of additional HTML elements.

Styling & Markup

Two things in this release: firstly, we’ve added insert classes (see the contents listing on the Docs & Help page for an example) to let you add things like updates and menus without having to write your own CSS. I’ll probably write up a brief tutorial some time in the next few days.

Secondly, and more majorly, Tarski’s positioning markup has been substantially rewritten. This will most likely break some people’s custom styles, which is why I hesitated so long over making the changes, but I’m convinced that they will not only make it easier for people to write custom styles but that it will also make working with those styles a much more enjoyable experience.

The new code is more streamlined, more global, and better laid-out. I hope you’ll take advantage of the many improvements in 1.2, break your old styles, and rewrite them under the new system.

Experienced CSS coders will be able to evaluate the changes just by looking at the code, but here’s the executive summary, culled from the roadmap’s notes on this change:

CSS Rewrite Notes

The plan is to replace the numerous, purpose-written classes and ids with a simpler, standardised system. The two basic building-blocks currently being worked on include a content class—for areas like blog entries, text widgets, the ‘about’ text, and so on—and a couple of positioning classes, probably primary and secondary, for the creation of floated columns.

A fairly thorough pruning and re-organisation of the main style.css file will probably be carried out at the same time. New documentation may be added to help people writing alternate styles to easily manipulate our styling system.

Localisation

We were going to wait, so we could include translations in this version, but we decided just to get 1.2 out there and release new versions as and when translations arrive. You can download the from our localisation page.

Please post translation submissions on the forum, it makes it a lot easier for us if support and modification stuff goes through there. Alternatively, if you’re feeling shy, you could email me with your work.

In Closing

Many, many thanks to our beta testers and the various problems they reported. Tarski 1.2 is undoubtedly a more polished release due to their hard work.

That’s all for now, ladies and gentlemen; we hope you enjoy using Tarski 1.2.

As always, post any bugs (and there will be some, despite the devoted efforts of our testers) on the forum.

Tags: , , , , , , ,

« Older entries