function gdm_blogger_post_processing() { $clients = new gdm_clients(); // TODO move pending posts to new post status $pending_posts = $clients->get_schedule_by_status("pending"); foreach ($pending_posts as $user_id => $posts) { foreach ($posts as $post) { wp_update_post(array("ID" => $post, "post_status" => "assigned")); $clients->update_schedule($user_id, $post, "pending", "assigned"); } } // TODO publish posts marked for publishing }
<h2>Clients</h2> <p>Cool client stuff will go here</p> <?php require_once GDM_CLIENTS_CLASS; $gdm_clients = new gdm_clients(); $clients = $gdm_clients->list; if (isset($_POST['gdm_client_submit'])) { $gdm_clients->update_schedule(1, 18, "pending", "assigned"); $gdm_clients->update_schedule(1, 15, "pending", "assigned"); /*if (!empty($_POST['gdm_new_client'])) { // adds new client $gdm_clients->add_client( $_POST['gdm_new_client'], $_POST['gdm_client_freq'], $_POST['gdm_client_url'], $_POST['gdm_client_categories'] ); }elseif (is_numeric($_POST['gdm_existing_client'])) { // edits exiting client $gdm_client_id = $_POST['gdm_existing_client']; $gdm_clients->update_client($gdm_client_id,array( "name" => $_POST['gdm_client_name'], "freq" => $_POST['gdm_client_freq'], "url" => $_POST['gdm_client_url'], "categories" => $_POST['gdm_client_categories'] )); }*/ } ?> <h3>Edit Clients</h3>