Make WordPress Core


Ignore:
Timestamp:
11/17/2005 03:26:24 AM (21 years ago)
Author:
ryan
Message:

New bookmarklet action.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-functions.php

    r3124 r3127  
    213213// Default post information to use when populating the "Write Post" form.
    214214function get_default_post_to_edit() {
    215         global $content, $excerpt, $edited_post_title;
     215        if ( !empty($_REQUEST['post_title']) )
     216                $post_title = wp_specialchars(stripslashes($_REQUEST['post_title']));
     217        else if ( !empty($_REQUEST['popuptitle']) ) {
     218                $post_title = wp_specialchars(stripslashes($_REQUEST['popuptitle']));
     219                $post_title = funky_javascript_fix($post_title);
     220        } else {
     221                $post_title = '';
     222        }
     223
     224        if ( !empty($_REQUEST['content']) )
     225                $post_content = wp_specialchars(stripslashes($_REQUEST['content']));
     226        else if ( !empty($post_title) ) {
     227                $text       = wp_specialchars(stripslashes(urldecode($_REQUEST['text'])));
     228                $text       = funky_javascript_fix($text);
     229                $popupurl   = wp_specialchars($_REQUEST['popupurl']);
     230        $post_content = '<a href="'.$popupurl.'">'.$post_title.'</a>'."\n$text";
     231    }
     232
     233        if ( !empty($_REQUEST['excerpt']) )
     234                $post_excerpt = wp_specialchars(stripslashes($_REQUEST['excerpt']));
     235        else
     236                $post_excerpt = '';
    216237
    217238        $post->post_status = 'draft';
     
    220241        $post->post_pingback = get_settings('default_pingback_flag');
    221242        $post->post_category = get_settings('default_category');
    222         $content = wp_specialchars($content);
    223         $post->post_content = apply_filters('default_content', $content);
    224         $post->post_title = apply_filters('default_title', $edited_post_title);
    225         $post->post_excerpt = apply_filters('default_excerpt', $excerpt);
     243        $post->post_content = apply_filters('default_content', $post_content);
     244        $post->post_title = apply_filters('default_title', $post_title);
     245        $post->post_excerpt = apply_filters('default_excerpt', $post_excerpt);
    226246        $post->page_template = 'default';
    227247        $post->post_parent = 0;
Note: See TracChangeset for help on using the changeset viewer.