Snippet: WordPress 3.0 Menus - Add a login / logout link

The new WordPress 3.0 menu system is pretty powerful and provides some very interesting new options for creating menus in WordPress. Previously, I have always used wplistpages and a custom Walker class to provide hierarchical menus based on the page structure, but that's a topic for another post. This…

Snippet: Magento - Using OR and LEFT JOIN in addAttributeToFilter

I'm still pretty new to Magento, and am learning more about it every day. I've been trying to learn all I can about internals such as managing collections & recently stumbled on trying to filter a collection by two attributes. I wanted to build a list of all products that…

Snippet: Symfony & Propel - Queries with SQL functions

This is a super short snippet that I ALWAYS forget how to do! Often I want to build more complex where clauses with Propel Criteria which use SQL functions such as UCASE, LCASE, LEN and the date functions DAY, MONTH and YEAR. This is possible using Propel & Criteria, but…

Snippet: Symfony Forms - Accessing the Object in a Form

Perusing my Google Analytics data shows up some interesting results. For starters the top search query which sends people to my blog is "symfony accessing object in a form". This has been consistent for several months, but there is no article on my blog which answers that question. I imagine…

Snippet: Wordpress Admin - Tidy Dashboard Widgets By Role

Recently I worked on a Wordpress site where I wanted to be able to customise the dashboard for different user roles. Wordpress has the default roles of administrators, editors, authors, contributors and subscribers. It's not too much to assume you might not want to show your editors or authors all…