X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/5aa86a9053fb0fa15846bb60aac2fb8fdfff524a..6c8f14c09105d0afa4c1574215c59b5021040e76:/wp-admin/press-this.php diff --git a/wp-admin/press-this.php b/wp-admin/press-this.php index 0c36dbf7..6542fa31 100644 --- a/wp-admin/press-this.php +++ b/wp-admin/press-this.php @@ -13,7 +13,7 @@ require_once('./admin.php'); header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset')); -if ( ! current_user_can('edit_posts') ) +if ( ! current_user_can( 'edit_posts' ) || ! current_user_can( get_post_type_object( 'post' )->cap->create_posts ) ) wp_die( __( 'Cheatin’ uh?' ) ); /** @@ -110,7 +110,7 @@ $image = isset($_GET['i']) ? $_GET['i'] : ''; if ( !empty($_REQUEST['ajax']) ) { switch ($_REQUEST['ajax']) { case 'video': ?> - @@ -351,12 +351,12 @@ var photostorage = false; '; } elseif ( preg_match("/vimeo\.com\/[0-9]+/i", $url) ) { - list($domain, $video_id) = split(".com/", $url); + list($domain, $video_id) = explode(".com/", $url); $video_id = esc_attr($video_id); $content = ' '; @@ -376,24 +376,15 @@ var photostorage = false; function setup_photo_actions() { jQuery('.close').click(function() { jQuery('#extra-fields').hide(); - jQuery('body').append( jQuery('#photo-add-url-div') ); jQuery('#extra-fields').html(''); }); jQuery('.refresh').click(function() { photostorage = false; - jQuery('body').append( jQuery('#photo-add-url-div') ); show('photo'); }); jQuery('#photo-add-url').click(function(){ - var container = jQuery('#img_container'); - - if ( container.children('#photo-add-url-div:visible').length ) { - container.children('a').show(); - jQuery('#photo-add-url-div').hide(); - } else { - container.children('a').hide(); - container.append( jQuery('#photo-add-url-div').show() ); - } + var form = jQuery('#photo-add-url-div').clone(); + jQuery('#img_container').empty().append( form.show() ); }); jQuery('#waiting').hide(); jQuery('#extra-fields').show(); @@ -423,7 +414,7 @@ var photostorage = false; } jQuery(document).ready(function($) { //resize screen - window.resizeTo(720,580); + window.resizeTo(740,580); // set button actions jQuery('#photo_button').click(function() { show('photo'); return false; }); jQuery('#video_button').click(function() { show('video'); return false; }); @@ -432,11 +423,11 @@ var photostorage = false; show('video'); show('video'); - + show('photo'); jQuery('#title').unbind(); - jQuery('#publish, #save').click(function() { jQuery('#saving').css('display', 'inline'); }); + jQuery('#publish, #save').click(function() { jQuery('.press-this #publishing-actions .spinner').css('display', 'inline-block'); }); $('#tagsdiv-post_tag, #categorydiv').children('h3, .handlediv').click(function(){ $(this).siblings('.inside').toggle(); @@ -444,7 +435,11 @@ var photostorage = false; }); - + +
@@ -472,7 +467,7 @@ var photostorage = false; echo '

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

-
    +
      'category', 'popular_cats' => $popular_ids ) ) ?>
@@ -522,18 +517,18 @@ var photostorage = false; cap->edit_terms) ) : ?>

- + labels->add_new_item ); ?>

- + - 'category', 'hide_empty' => 0, 'name' => 'newcategory_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => '— ' . $tax->labels->parent_item . ' —', 'tab_index' => 3 ) ); ?> - + 'category', 'hide_empty' => 0, 'name' => 'newcategory_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => '— ' . $tax->labels->parent_item . ' —' ) ); ?> +

@@ -553,7 +548,7 @@ var photostorage = false;
- +
@@ -591,7 +586,7 @@ var photostorage = false;
- + @@ -605,7 +600,7 @@ var photostorage = false; $content = ''; if ( $selection ) - $content .= $selection; + $content .= $selection; if ( $url ) { $content .= '

';