Hide empty boxes on the Story Budget

By default, the Story Budget will display boxes for each category even when there aren’t any posts. With a little CSS thoug, it’s possible to hide a category box if there aren’t any posts.

First, read the introduction to extending Edit Flow. Once you’ve done so, you can modify the code snippet below to work for your needs.

[sourcecode language=”php”]
add_action( ‘admin_head’, ‘efx_admin_head_hide_empty_boxes’ );
function efx_admin_head_hide_empty_boxes() {

if ( empty( $_GET[‘page’] ) || ‘story-budget’ != $_GET[‘page’] )
return;
?>
<style>
.postbox {
display: none;
}
.postbox.postbox-has-posts {
display:block;
}
</style>
<?php }
[/sourcecode]

Speak Your Mind

*