approving) || in_array($post_id, $this->deleting)){ return; } $this->deleting[] = $post_id; $post = get_post($post_id); // Ensure we're not working with a revision if($post->post_parent != 0){ return; } // Get dashboard post id and password $parent_id = get_post_meta($post_id, '_remote_id', true); // Make sure this is a postrunner post if($remote_id == 0){ return; } PostrunnerClient::approve_post($post_id, $parent_id, 'deleted', '', 0, ''); } function settings(){ register_setting('general', 'pr_share_pageviews'); // Add the section to reading settings so we can add our // fields to it add_settings_section('postrunner_settings_section', 'Postrunner Settings', array($this, 'display_settings_page'), 'general'); // Add the field with the names and function to use for our new // settings, put it in our new section add_settings_field('pr_share_pageviews', 'Share Traffic Data', array($this, 'share_pageviews_setting_callback'), 'general', 'postrunner_settings_section'); } function display_settings_page(){ // No intro text yet. } function share_pageviews_setting_callback() { echo '
Only (rough) number of daily visitors will be shared. No identifiable or unique information will be shared. Data is used to display a basic traffic level for your site in Postrunner listings.
'; } function post_page_setup() { global $post; // Remove normal publish box $remote_id = get_post_meta($post->ID, '_remote_id', true); // Ensure this post came from postrunner, and the current user is an admin if(current_user_can('manage_options') && $remote_id != 0){ remove_meta_box( 'submitdiv', 'post', 'side' ); add_meta_box('submitdiv', 'Publish or Decline Post', array($this, 'approval_box'), 'post', 'side', 'high'); } } // Adds the actual option box function approval_box() { global $post; $post_score = intval(get_post_meta($post->ID, '_pr_score', true)); $feedback = get_post_meta($post->ID, '_pr_feedback', true); $post_type = $post->post_type; $post_type_object = get_post_type_object($post_type); $can_publish = current_user_can($post_type_object->cap->publish_posts); ?>Please score this post
post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) {
if ( $can_publish ) :
if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?>
'5', 'accesskey' => 'p' ) ); ?>
'5', 'accesskey' => 'p' ) ); ?>
'5', 'accesskey' => 'p' ) ); ?>
".$notice['message']."
\n"; echo "