Artiss Draft List (formerly Simple Draft List) will display a list of the titles of your posts/pages that have not yet been published.
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' ); ?>
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...
page. The default is both.
cto represent the title, modified date or created date and the second is
dfor ascending or descending. Therefore
order=tdwill display the results in descending title sequence. The default is descending modified date.
Nothen scheduled posts will not display in the list, only drafts.
scheduled.png. However, use this parameter to specify a folder within your theme that you'd prefer the icon to be fetched from.
Noto not cache at all. Whenever you save a post any cache will be cleared to ensure that any lists are updated.
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.
6 monthswould only list drafts that have been modified in the last 6 months.
6 monthswould 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; ?>
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.
Sidebar widgets can be easily added. In Administration simply click on the
Widgets option under the
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.
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...
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.
If you wish to omit a page or post from the list then you can do this in 3 ways...
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.
This WordPress plugin is licensed under the GPLv2 (or later).
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).
This plugin, and all support, is supplied for free, but donations are always welcome.