コード例 #1
0
ファイル: bookmarklet.php プロジェクト: robertlange81/Website
<script type="text/javascript">
<!--
window.close()
-->
</script>
</head>
<body></body>
</html>
<?php 
    exit;
}
$post = get_default_post_to_edit();
$popuptitle = wp_specialchars(stripslashes($popuptitle));
$text = wp_specialchars(stripslashes(urldecode($text)));
$popuptitle = funky_javascript_fix($popuptitle);
$text = funky_javascript_fix($text);
$post_title = wp_specialchars($_REQUEST['post_title']);
if (!empty($post_title)) {
    $post->post_title = stripslashes($post_title);
} else {
    $post->post_title = $popuptitle;
}
$content = wp_specialchars($_REQUEST['content']);
$popupurl = wp_specialchars($_REQUEST['popupurl']);
if (!empty($content)) {
    $post->post_content = wp_specialchars(stripslashes($_REQUEST['content']));
} else {
    $post->post_content = '<a href="' . $popupurl . '">' . $popuptitle . '</a>' . "\n{$text}";
}
/* /big funky fixes */
?>
コード例 #2
0
function get_default_post_to_edit()
{
    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 = clean_url(stripslashes($_REQUEST['popupurl']));
            $post_content = '<a href="' . $popupurl . '">' . $post_title . '</a>' . "\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');
    $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;
    return $post;
}
コード例 #3
0
ファイル: post.php プロジェクト: bluedanbob/wordpress
/**
 * Default post information to use when populating the "Write Post" form.
 *
 * @since unknown
 *
 * @return unknown
 */
function get_default_post_to_edit()
{
    if (!empty($_REQUEST['post_title'])) {
        $post_title = esc_html(stripslashes($_REQUEST['post_title']));
    } else {
        if (!empty($_REQUEST['popuptitle'])) {
            $post_title = esc_html(stripslashes($_REQUEST['popuptitle']));
            $post_title = funky_javascript_fix($post_title);
        } else {
            $post_title = '';
        }
    }
    $post_content = '';
    if (!empty($_REQUEST['content'])) {
        $post_content = esc_html(stripslashes($_REQUEST['content']));
    } else {
        if (!empty($post_title)) {
            $text = esc_html(stripslashes(urldecode($_REQUEST['text'])));
            $text = funky_javascript_fix($text);
            $popupurl = esc_url($_REQUEST['popupurl']);
            $post_content = '<a href="' . $popupurl . '">' . $post_title . '</a>' . "\n{$text}";
        }
    }
    if (!empty($_REQUEST['excerpt'])) {
        $post_excerpt = esc_html(stripslashes($_REQUEST['excerpt']));
    } else {
        $post_excerpt = '';
    }
    $post->ID = 0;
    $post->post_name = '';
    $post->post_author = '';
    $post->post_date = '';
    $post->post_date_gmt = '';
    $post->post_password = '';
    $post->post_status = 'draft';
    $post->post_type = 'post';
    $post->to_ping = '';
    $post->pinged = '';
    $post->comment_status = get_option('default_comment_status');
    $post->ping_status = get_option('default_ping_status');
    $post->post_pingback = get_option('default_pingback_flag');
    $post->post_category = get_option('default_category');
    $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;
    return $post;
}