How to Display Properly Formatted Content From a $post Object in WordPress

How to Display Properly Formatted Content From a $post Object in WordPress

Occasionally, I’ll run into a situation where I need to call a post specifically using the get_post() function.  get_post() returns a Post object, with a number of member variables – the one that stores the actual content of the post being post_content. However, if you try just echoing $post->post_content, you’ll get completely unformatted text – which [...]

Get the Current Admin Page Title in a Plugin

Get the Current Admin Page Title in a Plugin

Here’s something that comes up for me pretty often:  depending on what I’m trying to do, I sometimes need plugin functions to run (or not run) simply based on which admin page the user is visiting.   Here’s the WordPress function that will give you the title of the currently loaded admin page:

get_admin_page_title()

So, if you only [...]

How To: Get an Overview of all Action and Filter Hooks

How To:  Get an Overview of all Action and Filter Hooks

Here’s a very cool little tidbit I found today (strangely enough, I found it in the bbpress codebase, while working on a bbpress plugin..)  Wordpress keeps track of which function/filter combinations are registered, along with which action hooks have been called at any point.  If you’re having trouble trying to figure out which action hook [...]

Saving Wordpress Plugin Options – Admin Panels Done Right

Saving Wordpress Plugin Options – Admin Panels Done Right

This isn’t a terribly difficult task – it’s incredibly common, and it’s covered multiple places in the codex. So why am I writing about it? A few months ago, I was tasked with customizing a plugin – one that someone else wrote. I need to add some options to it, and their [...]

Creating User Friendly Custom Fields by Modifying the Post Page

Creating User Friendly Custom Fields by Modifying the Post Page

Ralph over at ForTheLose.org wrote up a great post on how to use custom fields in wordpress a few days ago, and I thought I’d expand on it with another feature that I use for clients quite often.  Custom fields are a great way to store extra post information, and they can really make for [...]

Running Wordpress Admin Functions from a Cron Job

Running Wordpress Admin Functions from a Cron Job

The quick version?  Include wp-load.php and wp-admin/admin-functions.php in a file in the plugin directory, and point your cron there.  For those of you with nothing important to do, a long winded explanation: I ran into a project a few days ago where the client needed a simple plugin put together – read an xml file, pull [...]

Widgetizing a Wordpress Plugin: Example Widget Code

Widgetizing a Wordpress Plugin:  Example Widget Code

So, every time I need to write a widget for a client, or for a site I’m working on, I have to fire up google. Even though its something I do relatively often, I just can’t seem to remember what exactly I need to hook into, and how to build the actual widget function. Fortunately, this information [...]