X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/a5227bf01edbe6660486c9f5c0f0ed7b7fea3130..refs/tags/wordpress-3.2-scripts:/wp-admin/press-this.php diff --git a/wp-admin/press-this.php b/wp-admin/press-this.php index 04f8d0f5..70f1808a 100644 --- a/wp-admin/press-this.php +++ b/wp-admin/press-this.php @@ -6,8 +6,11 @@ * @subpackage Press_This */ +define('IFRAME_REQUEST' , true); + /** WordPress Administration Bootstrap */ require_once('./admin.php'); + header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset')); if ( ! current_user_can('edit_posts') ) @@ -24,6 +27,7 @@ if ( ! current_user_can('edit_posts') ) */ function press_it() { // define some basic variables + $quick = array(); $quick['post_status'] = 'draft'; // set as draft first $quick['post_category'] = isset($_POST['post_category']) ? $_POST['post_category'] : null; $quick['tax_input'] = isset($_POST['tax_input']) ? $_POST['tax_input'] : null; @@ -64,6 +68,18 @@ function press_it() { wp_delete_post($post_ID); wp_die($upload); } else { + // Post formats + if ( current_theme_supports( 'post-formats' ) && isset( $_POST['post_format'] ) ) { + $post_formats = get_theme_support( 'post-formats' ); + if ( is_array( $post_formats ) ) { + $post_formats = $post_formats[0]; + if ( in_array( $_POST['post_format'], $post_formats ) ) + set_post_format( $post_ID, $_POST['post_format'] ); + elseif ( '0' == $_POST['post_format'] ) + set_post_format( $post_ID, false ); + } + } + $quick['ID'] = $post_ID; wp_update_post($quick); } @@ -115,7 +131,7 @@ if ( !empty($_REQUEST['ajax']) ) {

- +

@@ -209,7 +225,7 @@ if ( !empty($_REQUEST['ajax']) ) { $src = 'http://'.str_replace('//','/', $host['host'].'/'.$src); else $src = 'http://'.str_replace('//','/', $host['host'].'/'.dirname($host['path']).'/'.$src); - $sources[] = esc_attr($src); + $sources[] = esc_url($src); } return "'" . implode("','", $sources) . "'"; } @@ -224,22 +240,22 @@ if ( !empty($_REQUEST['ajax']) ) { if(photostorage == false) { var my_src = eval( jQuery.ajax({ - type: "GET", - url: "", + type: "GET", + url: "", cache : false, async : false, - data: "ajax=photo_images&u=", + data: "ajax=photo_images&u=", dataType : "script" }).responseText ); if(my_src.length == 0) { var my_src = eval( jQuery.ajax({ - type: "GET", - url: "", + type: "GET", + url: "", cache : false, async : false, - data: "ajax=photo_images&u=", + data: "ajax=photo_images&u=", dataType : "script" }).responseText ); @@ -296,7 +312,7 @@ if ( !empty($_REQUEST['ajax']) ) { jQuery('#extra-fields').html(''); return false; } - jQuery('#extra-fields').html('

Add Photos ()

'); + jQuery('#extra-fields').html('

()

'); jQuery('#img_container').html(strtoappend); @@ -331,9 +346,6 @@ var photostorage = false; do_action('admin_print_styles'); do_action('admin_print_scripts'); do_action('admin_head'); - - if ( user_can_richedit() ) - wp_tiny_mce( true, array( 'height' => '370' ) ); ?> - + '370' ) ); +} +?>
-

- @@ -467,21 +479,36 @@ var photostorage = false;
-
-
-
-
-

+
+

+

-

- - - - -

- +

+ 'save' ) ); + if ( current_user_can('publish_posts') ) { + submit_button( __( 'Publish' ), 'primary', 'publish', false ); + } else { + echo '

'; + submit_button( __( 'Submit for Review' ), 'primary', 'review', false ); + } ?>

+ +

+ +

+
@@ -536,7 +563,7 @@ var photostorage = false;
-
+

@@ -553,12 +580,22 @@ var photostorage = false;

- +
+ + +

| |

@@ -572,26 +609,26 @@ var photostorage = false;
-
    - -
  • - Add: -<?php _e('Insert an Image'); ?> - -
  • -
  • - <?php _e('Embed a Video'); ?> -
  • - -
  • - - +
    +
    -
  • - -
+ + +
+ + +<?php _e('Insert an Image'); ?><?php _e('Embed a Video'); ?> +
+