Here’s something that touches on lots of topics. A ‘send e-mail’ button within an admin panel, that opens up a ThickBox window with a standalone form and wp_editor.
The metabox
This requires two functions: one hooked into ‘add_meta_boxes’ which calls the second, the metabox output function:
Most of the second function builds the URL for the button’s href attribute. It points to a ...
Read article
You may already know, custom post types are the real workhorses of most customized WordPress themes. But often, they’re not meant to be read by the public; they’re functional things like ‘albums’ or ‘reservations’ or ‘index cards.’ By default, WordPress tries to create auto-drafts of any post type when an author is adding / editing through the admin panel, and ...
Read article
A client wanted to display items with ‘Draft’ status differently (gray color) in the admin list pages. Some might argue I’m a sloppy coder for using inline CSS, but there’s something I like about targeted post types, particularly in admin pages. Anyway, here’s a good example of using the ‘admin_footer’ action and certain global variables, very useful.
This snippet (stick it ...
Read article
Recently, I was tasked with coding a ‘members only’ site which required a login to view all but a few pages. This turned out to be a surprisingly simple task, so I thought I’d share the code here. The job broke down into three tasks:
Allow anyone who’s logged in or else redirect to the Login page.
Otherwise, allow if the current ... Read article