trackEvent('WP-Logs', $data['event'], $data['user_id'], $data['text']); $post = array( 'post_type' => 'EventLog', 'post_content' => $data['text'], 'post_title' => $data['event'], 'post_status' => 'publish', 'post_author' => ($data['user_id'] != '' ? $data['user_id'] : 1) //if no user id given, post from admin account ); $post_id = wp_insert_post($post); // if (from_array ($data, 'notifo') && function_exists('notifo_message')) // notifo_message($data['event'],$data['text'],get_permalink($post_id)); //remove things that wont be in metadata unset($data['text'],$data['event'],$data['user_id']); //save everything else as metadata foreach ($data as $item => $value) update_post_meta($post_id, 'log_'.$item, $value); } } } ?> __('Logs'), 'public' => true, 'show_ui' => true, 'exclude_from_search' => true, 'show_in_nav_menus' => false, 'supports' => array( 'title', 'editor', 'tags', 'author', // frinzer: author added ), 'menu_position' => 5 ) ); //remove the 'Add New' link global $submenu; unset($submenu['edit.php?post_type=EventLog'][10]); } function EventLog_edit_columns($columns){ $columns = array( "cb" => "", "title" => "Title", "timestamp" => "Timestamp", "user" => "User" ); return $columns; } function EventLog_custom_columns($column){ global $post; $custom = get_post_custom($post->ID); switch ($column) { case "timestamp": print date('m-d-Y h:i:a',strtotime($post->post_date)); break; case "user": $user = get_userdata($post->post_author); print $user->ID . ' (' . $user->user_login . ')'; break; } } ?> Redirecting... - Beachadvisor
Contacting Facebook, please wait...