function post_footer_meta_box_content() { if (isset($_GET['post'])) { $post = $_GET['post']; } else { $post = '-' . time(); } $_post_footer_id = get_post_meta($post, '_post_footer_id', true); $snippets = _post_footer_snippets(); ?> <?php wp_nonce_field('wp_post_footer_nonce', 'wp_post_footer_nonce'); ?> <label for="_post_footer_id">Post Footer snippet:</label> <select name="_post_footer_id" id="post_footer_id"> <option value="">Choose…</option> <?php foreach ($snippets as $snippet) { $selected = $snippet->ID == $_post_footer_id ? 'selected="selected"' : ''; ?> <option value="<?php echo $snippet->ID; ?> " <?php echo $selected; ?> ><?php echo $snippet->post_title; ?> </option> <?php } ?> </select> <?php }
<?php $posts = _post_footer_snippets(); if (isset($_GET['pfmsg'])) { ?> <div id="message" class="updated fade"><p>Post Footer snippet deleted.</p></div> <?php } ?> <div class="wrap"> <div id="icon-edit" class="icon32"></div> <h2>Post Footer Library <a class="button add-new-h2" href="edit.php?page=<?php echo end(explode('/', dirname(__FILE__))); ?> /add-wp-post-footer.php">Add New</a></h2> <p>Manage your Post Footer snippets</p> <div class="clear"></div> <table class="widefat post fixed" cellspacing="0"> <thead> <tr> <th scope="col" id="title" class="manage-column column-title" style="">Post</th> <th scope="col" id="author" class="manage-column column-author" style="">Author</th> <th scope="col" id="date" class="manage-column column-date" style="">Date</th> <th scope="col" class="manage-column column-date" style="">Remove?</th> </tr> </thead> <tfoot> <tr> <th scope="col" class="manage-column column-title" style="">Post</th> <th scope="col" class="manage-column column-author" style="">Author</th> <th scope="col" class="manage-column column-date" style="">Date</th>