From eb4979a6401a21be30e0ca0dd7ce8462361aa571 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Thu, 17 Nov 2005 03:26:24 +0000 Subject: [PATCH] New bookmarklet action. git-svn-id: https://develop.svn.wordpress.org/trunk@3127 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/admin-functions.php | 30 +++++++++++++++++++++++++----- wp-admin/edit-form-advanced.php | 8 +++++++- wp-admin/post.php | 7 ++++--- 3 files changed, 36 insertions(+), 9 deletions(-) diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index f078dcf4d2..f375368483 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -212,17 +212,37 @@ function get_post_to_edit($id) { // Default post information to use when populating the "Write Post" form. function get_default_post_to_edit() { - global $content, $excerpt, $edited_post_title; + if ( !empty($_REQUEST['post_title']) ) + $post_title = wp_specialchars(stripslashes($_REQUEST['post_title'])); + else if ( !empty($_REQUEST['popuptitle']) ) { + $post_title = wp_specialchars(stripslashes($_REQUEST['popuptitle'])); + $post_title = funky_javascript_fix($post_title); + } else { + $post_title = ''; + } + + if ( !empty($_REQUEST['content']) ) + $post_content = wp_specialchars(stripslashes($_REQUEST['content'])); + else if ( !empty($post_title) ) { + $text = wp_specialchars(stripslashes(urldecode($_REQUEST['text']))); + $text = funky_javascript_fix($text); + $popupurl = wp_specialchars($_REQUEST['popupurl']); + $post_content = ''.$post_title.''."\n$text"; + } + + if ( !empty($_REQUEST['excerpt']) ) + $post_excerpt = wp_specialchars(stripslashes($_REQUEST['excerpt'])); + else + $post_excerpt = ''; $post->post_status = 'draft'; $post->comment_status = get_settings('default_comment_status'); $post->ping_status = get_settings('default_ping_status'); $post->post_pingback = get_settings('default_pingback_flag'); $post->post_category = get_settings('default_category'); - $content = wp_specialchars($content); - $post->post_content = apply_filters('default_content', $content); - $post->post_title = apply_filters('default_title', $edited_post_title); - $post->post_excerpt = apply_filters('default_excerpt', $excerpt); + $post->post_content = apply_filters('default_content', $post_content); + $post->post_title = apply_filters('default_title', $post_title); + $post->post_excerpt = apply_filters('default_excerpt', $post_excerpt); $post->page_template = 'default'; $post->post_parent = 0; $post->menu_order = 0; diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index 37198edfa7..fab4f20cd6 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -8,6 +8,10 @@ $messages[3] = __('Custom field deleted.');
+ + +

@@ -204,7 +208,9 @@ if ('publish' != $post->post_status || 0 == $post_ID) { } ?> - + +