• About
scot hacker's scripts and utils

Author/Editor Documentation Plugin for WordPress

October 7, 2010 9:21 am / Leave a Comment / shacker

For sites with multiple authors and editors, there is often a need to provide a style guide and/or technical instructions for site contributors. This very simple plugin will create a “Site Notes” menu item in the WP Dashboard. Clicking it will take the user to a page or set of pages. The administrator simple creates the site documentation in HTML format and stores it in the plugin body itself. I know, not very elegant – this is meant to be quick-n-dirty – but gets the job done.

Create a file called site-docs.php or similar with the following contents, upload it to your plugins directory, and activate. That’s all there is to it.

In my example, we just use in-page anchors to separate the different documentation sections, but you can do whatever you like. Season to taste.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
/*
Plugin Name: Site Documentation
Plugin URI: http://software.birdhouse.org
Description: Documentation for site authors and editors
Version: 1.0
Author: Scot Hacker
Author URI: http://birdhouse.org/
License: GPL
Last modified: 2007-05-05 9:54pm EDT
*/
 
// mt_add_pages() is the sink function for the 'admin_menu' hook
function mt_add_pages() {
    // Add a submenu to the Dashboard:
    add_submenu_page('index.php', 'Stuck Notes', 'Stuck Notes', 2, 'stuck-notes', 'stuck_notes');
}
 
 
 
// stuck_notes() displays the page content for the Stuck Notes submenu
function stuck_notes() {
echo <<< EOF
<p><a name="top" id="top"></a></p>
 
<div class="wrap">
	<h2>Stuck Notes - Docs and tips for writers/editors</h2>
 
	<div class="wrap">
		<ul>
			<li><a href="#process">Review process</a></li>
			<li><a href="#style">Editorial style notes</a></li>
			<li><a href="#contrib">...</a></li>					
		</ul>
	</div>
 
	<p><a name="process" id="process"></a></p>
 
	<div class="wrap">
		<h3>Review process</h3>
 
		<p>...</p>
 
		<p><a href="#top">Back to top</a></p>
	</div>
 
	<p><a name="style" id="style"></a></p>
 
	<div class="wrap">
		<h3>Style notes</h3>
 
		<p>...</p>
		<p><a href="#top">Back to top</a></p>
	</div>
 
</div>
 
EOF;
}
 
// Insert the mt_add_pages() sink into the plugin hook list for 'admin_menu'
add_action('admin_menu', 'mt_add_pages');
?>

<?php /* Plugin Name: Site Documentation Plugin URI: http://software.birdhouse.org Description: Documentation for site authors and editors Version: 1.0 Author: Scot Hacker Author URI: http://birdhouse.org/ License: GPL Last modified: 2007-05-05 9:54pm EDT */ // mt_add_pages() is the sink function for the 'admin_menu' hook function mt_add_pages() { // Add a submenu to the Dashboard: add_submenu_page('index.php', 'Stuck Notes', 'Stuck Notes', 2, 'stuck-notes', 'stuck_notes'); } // stuck_notes() displays the page content for the Stuck Notes submenu function stuck_notes() { echo <<< EOF <p><a name="top" id="top"></a></p> <div class="wrap"> <h2>Stuck Notes - Docs and tips for writers/editors</h2> <div class="wrap"> <ul> <li><a href="#process">Review process</a></li> <li><a href="#style">Editorial style notes</a></li> <li><a href="#contrib">...</a></li> </ul> </div> <p><a name="process" id="process"></a></p> <div class="wrap"> <h3>Review process</h3> <p>...</p> <p><a href="#top">Back to top</a></p> </div> <p><a name="style" id="style"></a></p> <div class="wrap"> <h3>Style notes</h3> <p>...</p> <p><a href="#top">Back to top</a></p> </div> </div> EOF; } // Insert the mt_add_pages() sink into the plugin hook list for 'admin_menu' add_action('admin_menu', 'mt_add_pages'); ?>

Posted in: WordPress

Leave a Reply

Your email address will not be published. Required fields are marked *

Post Navigation

← Previous Post
Next Post →

Categories

  • AMP
  • BeOS
  • cPanel
  • Django
  • Geo
  • Mac
  • Movable Type
  • Music
  • Performance
  • Python
  • QuickTime Streaming Server
  • Spam
  • Twitter
  • WordPress
© Copyright 2025 - scot hacker's scripts and utils
Infinity Theme by DesignCoral / WordPress