# edit-flow/0.1.5/php/dashboard.php

Edit Flow, version 0.1.5. 58 lines.

- Page: https://pluginprobe.com/plugins/edit-flow/0.1.5/code/php/dashboard.php
- Raw: https://pluginprobe.com/plugins/edit-flow/0.1.5/raw/php/dashboard.php
- Modified: 2009-06-13T15:30:54+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/edit-flow/0.1.5/code/php/dashboard.php#L10-L20`.

```php
<?php

// Code for all dashboard widgets will go here

class edit_flow_dashboard {
	
	function __construct ( ) {
		add_action('wp_dashboard_setup', array(&$this, 'add_dashboard_widgets') );
	}
	
	function add_dashboard_widgets ( ) {
		global $edit_flow;
		
		// Set up Post Status widget
		// But, first check to see if it's enabled
		if($edit_flow->get_plugin_option('post_status_widget_enabled')) wp_add_dashboard_widget('post_status_widget', 'Unpublished Content', array(&$this, 'post_status_widget'));
	}
	
	/**
	 * Creates Post Status widget
	 * Display an at-a-glance view of post counts for all custom statuses in the system
	 */
	function post_status_widget ( ) {
		global $edit_flow;
		
		$statuses = $edit_flow->custom_status->get_custom_statuses();
		?>
		<p class="sub">Posts at a Glance</p>
		
		<div class="table">
			<table>
				<tbody>
		
					<?php foreach($statuses as $status) : ?>
						<?php $filter_link = get_custom_status_filter_link($status->slug) ?>
						<tr>
							<td class="b">
								<a href="<?php echo $filter_link; ?>">
									<?php echo get_custom_status_post_count($status->slug); ?>
								</a>
							</td>
							<td>
								<a href="<?php echo $filter_link; ?>"><?php echo $status->name ?></a>
								<span class="small"><a href="<?php echo get_custom_status_edit_link($status->term_id) ?>">[edit]</a></span>
							</td>
						</tr>
							
					<?php endforeach; ?>
				</tbody>
			</table>
		</div>
		<?php
	}
	
}


?>
```
