'; } } add_action('admin_head', 'bc_admin_head'); function bc_admin_screen() { global $wpdb, $bc_urls; // Maybe make this an option some time $per_page = 15; $paged = empty($_GET['paged']) ? 1 : intval($_GET['paged']); $orderbys = array( 'Author' => 'post_author', 'Date Posted' => 'post_date', 'Date Modified' => 'post_modified', 'Title' => 'post_title', 'Status' => 'post_status' ); $orderbys_flip = array_flip($orderbys); // Sorting $orderby = ( in_array($_GET['orderby'], $orderbys) ) ? $_GET['orderby'] : 'post_date'; $order = ( strtolower($_GET['order']) == 'asc' ) ? 'asc' : 'desc'; $_POST = stripslashes_deep($_POST); $_GET = stripslashes_deep($_GET); $posts = array(); $num = intval($_GET['num']); $what = htmlentities($_GET['what']); $message = ''; // Deal with any update messages we might have: switch ( $_GET['done'] ) { case 'add': $message = "Added $num posts to the category “$what”."; break; case 'remove': $message = "Removed $num posts from the category “$what”."; break; case 'tag': $message = "Tagged $num posts with “$what”."; break; case 'untag': $message = "Untagged $num posts with “$what”."; break; } if ( !empty($message) ) { echo "
$message
To get started, select some criteria above.
'; } else { // Criteria were given, but no posts were matched. if ( empty($posts) ) { echo 'No posts matched that criteria, sorry! Try again with something different.
'; } // Criteria were given, posts were matched... let's go! else { echo '