custom_status->get_custom_statuses(); // Get the status of the current post if($post_ID==0) { $selected = $edit_flow->get_plugin_option('custom_status_default_status'); } else { $selected = $post->post_status; } // Alright, we want to set up the JS var which contains all custom statuses $count = 1; $status_array = ''; // Add the "Publish" status if the post is published if($selected == "publish") $status_array .= "{ name: 'Published', slug: 'publish' }, "; foreach($custom_statuses as $status) { $status_array .= "{ name: '". addslashes($status->name) ."', slug: '". $status->slug ."'}"; $status_array .= ($count == count($custom_statuses)) ? '' : ','; $count++; } // Now, let's print the JS vars ?>