WordPress.org

Ready to get started?Download WordPress

Plugin Directory

Artiss Draft List

Artiss Draft List (formerly Simple Draft List) will display a list of the titles of your posts/pages that have not yet been published.

Using a PHP Function Call

You would use this option is you wished to display the list outside of a page or post - e.g. in a sidebar. To display the list you will need to insert the following code, where appropriate, into your themeā€¦

<?php draft_list( 'template', 'parameters' ); ?>

Where template is a default layout (see Templates section below) and parameters is an optional list of parameters, each seperated by an ampersand (&)

The following parameters are valid...

  • limit= : The maximum number of draft items to display. The default is 0, which is unlimited.
  • type= : This allows you to limit the results to either post or page. The default is both.
  • order= : This is the sequence that you'd like to order the results in. It consists of 2 codes - the first is either t, m or c to represent the title, modified date or created date and the second is a or d for ascending or descending. Therefore order=td will display the results in descending title sequence. The default is descending modified date.
  • scheduled= : If specified as No then scheduled posts will not display in the list, only drafts.
  • folder= : The scheduled icon will be, by default, the one in the plugin folder named scheduled.png. However, use this parameter to specify a folder within your theme that you'd prefer the icon to be fetched from.
  • cache= : How long to cache the output for, in hours. Defaults to half an hour. Set to No to not cache at all. Whenever you save a post any cache will be cleared to ensure that any lists are updated.
  • template= : This is the template which formats the output. See the section below on * *Templates** for further information.
  • date= : The format of any dates output. This uses the PHP date formatting system - read here for the formatting codes. Defaults to F j, Y, g:i a.

To restrict the posts/pages to a particular timeframe you can use the following 2 parameters. You simply state, in words, how long ago the posts must be dated for e.g. "2 days", "3 months", etc.

  • modified= : This reflects how long ago the post/page must have been modified last for it to be listed. For example 6 months would only list drafts that have been modified in the last 6 months.
  • created= : his reflects how long ago the post/page must have been created for it to be listed. For example 6 months would only list drafts that were created in the last 6 months.

The plugin will then display details of each draft item, depending on the parameters and template used.

An example would be...

<?php draft_list( '%ul%%draft% %icon%', 'limit=5&type=post&order=ma' ); ?>

This would display a list of up to 5 draft posts in ascending modified date sequence, with an icon displayed to the right of each if the draft is scheduled.

The following is an example of how it could be used in the sidebar, with a function_exists check so that it doesn't cause problems if the plugin is not active...

<?php if ( function_exists( 'draft_list' ) ) : ?>
<h2>Coming Soon</h2>
<?php draft_list( '%ul%%draft% %icon%', 'limit=5&type=post&order=ma' ); ?>
<?php endif; ?>

Using a Shortcode

Use this option to display the list within a post or page.

An example would be...

[drafts limit=5 type=post order=ma scheduled=no template='%ul%%draft% %icon%']

Parameters are listed with a space separating then, rather than the ampersand used before. Regardless, all the parameters used by the PHP Function are available with the shortcode.

Using a Widget

Sidebar widgets can be easily added. In Administration simply click on the Widgets option under the Appearance menu. Draft Posts will be one of the listed widgets. Drag it to the appropriate sidebar on the right hand side and then choose your options.

Save the result and that's it! You can use unlimited widgets, so you can add different lists to different sidebars.

Templates

The template parameter allows you to format the output by allowing you to specify how each line of output will display. A number of tags can be added, and you can mix these with HTML. The available tags are as follows...

  • %ul% - Specifies this is an un-ordered list (i.e. bullet point output). This MUST be specified at the beginning of the template if it is to be used.
  • %ol% - Specifies this is an ordered list (i.e. number output). This MUST be specified at the beginning of the template if it is to be used.
  • %icon% - This is the icon that indicates a scheduled post.
  • %draft% - This is the draft post details. This is the only REQUIRED tag.
  • %author% - This is the name of the post author.
  • %author+link% - This is the name of the post author with, where available, a link to their URL.
  • %words% - The number of words in the draft post.
  • %chars% - The number of characters (exc. spaces) in the draft post.
  • %chars+space% - The number of characters (inc. spaces) in the draft post.
  • %created% - The date/time the post was created.
  • %modified% - The date/time the post was last modified.
  • %category% - Shows the first category assigned to the post.
  • %categories% - Shows all categories assigned to the post, comma seperated.

If %ul% or %ol% are specified then all the appropriate list tags will be added to the output. If neither are used then it's assumed that line output will be controlled by yourself.

Omitting Posts/Pages from Results

If you wish to omit a page or post from the list then you can do this in 3 ways...

  1. By giving the post/page a title beginning with an exclamation mark. You can then remove this before publishing the page/post.
  2. The post and page editor has a meta box, where you can select to hide the page/post.
  3. You can add a custom field to a page/post with a name of 'draft_hide' and a value of 'Yes'

If the current user can edit the draft item being listed then it will be linked to the appropriate edit page. The user then simply needs to click on the draft item to edit it.

There are separate permissions for post and page editing, so an editor with just one permission may find that they can only edit some of the draft items.

Drafts that don't have a title will not be shown on the list UNLESS the current user has edit privilages for the draft - in this case a title of [No Title] will be shown.

Licence

This WordPress plugin is licensed under the GPLv2 (or later).

Support

All of my plugins are supported via my website.

Please feel free to visit the site for plugin updates and development news - either visit the site regularly or follow me on Twitter (@artiss_tech).

For problems, suggestions or enhancements for this plugin, there is a dedicated page and a forum. The dedicated page will also list any known issues and planned enhancements.

This plugin, and all support, is supplied for free, but donations are always welcome.

Requires: 2.0 or higher
Compatible up to: 3.4.2
Last Updated: 2012-11-27
Downloads: 3,189

Ratings

5 stars
5 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1
100,1,1
100,1,1