From c6693211df458cb4d91ca0b3eb2e27829e87d064 Mon Sep 17 00:00:00 2001 From: Mike Little Date: Sun, 10 Aug 2003 22:55:01 +0000 Subject: [PATCH] Change from Alex King: "I've changed the b2bookmarklet so that you can pass in "post_title" and "content" to the bookmarklet through the URL. I am using this to "post" to WordPress from tasks. I think this is a good integration point for outside apps that want a lightweight way (not XML-RPC) to post to WordPress. " git-svn-id: https://develop.svn.wordpress.org/trunk@305 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/b2bookmarklet.php | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/wp-admin/b2bookmarklet.php b/wp-admin/b2bookmarklet.php index 58590faf57..82c49c77db 100644 --- a/wp-admin/b2bookmarklet.php +++ b/wp-admin/b2bookmarklet.php @@ -1,6 +1,8 @@ */ +// accepts 'post_title' and 'content' as vars passed in. Add-on from Alex King + function selected($selected, $current) { if ($selected == $current) echo ' selected="selected"'; } @@ -102,6 +104,20 @@ if (($is_gecko) && (!isset($Gecko_bookmarklet_fix))) { $text = preg_replace($b2_gecko_correction["in"],$b2_gecko_correction["out"],$text); } +$post_title = $_REQUEST['post_title']; +if (!empty($post_title)) { + $post_title = stripslashes($post_title); +} else { + $post_title = $popuptitle; +} + +$content = $_REQUEST['content']; +if (!empty($content)) { + $content = stripslashes($content); +} else { + $content = ''.$popuptitle.''."\n$text"; +} + /* /big funky fixes */ @@ -112,7 +128,7 @@ if (($is_gecko) && (!isset($Gecko_bookmarklet_fix))) { +
Category
@@ -178,7 +194,7 @@ if ((preg_match("/Nav/",$HTTP_USER_AGENT)) || (preg_match("/Mozilla\/4\.7/",$HTT preg_match("/\%u[1-9A-F][1-9A-F][1-9A-F][1-9A-F]/is", $text, $stufftofix); // ... and so on. currently coding the fix ?> -
+