summaryrefslogtreecommitdiffstats
path: root/wp-admin
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-01-16 21:27:04 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-01-16 21:27:04 +0000
commit72e9496bfc2f7a962cf4f428ccab25c7a0175aaa (patch)
treeaf3e2ca7136c77140d9e9201e3f495a4b8e7a6da /wp-admin
parent04b67169db33e30f5ca63dbbafe551fdc6fb2164 (diff)
downloadwordpress-mu-72e9496bfc2f7a962cf4f428ccab25c7a0175aaa.tar.gz
wordpress-mu-72e9496bfc2f7a962cf4f428ccab25c7a0175aaa.tar.xz
wordpress-mu-72e9496bfc2f7a962cf4f428ccab25c7a0175aaa.zip
WP Merge to rev 4753
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@849 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin')
-rw-r--r--wp-admin/admin-db.php7
-rw-r--r--wp-admin/admin-functions.php10
-rw-r--r--wp-admin/link-import.php2
-rw-r--r--wp-admin/options-discussion.php2
-rw-r--r--wp-admin/upgrade-functions.php13
-rw-r--r--wp-admin/upload-js.php12
6 files changed, 28 insertions, 18 deletions
diff --git a/wp-admin/admin-db.php b/wp-admin/admin-db.php
index 40b4556..eab830e 100644
--- a/wp-admin/admin-db.php
+++ b/wp-admin/admin-db.php
@@ -141,9 +141,6 @@ function wp_insert_category($catarr) {
// Keep in mind when using this filter and altering the cat_ID that the two queries above
// have already taken place with the OLD cat_ID
// Also note that you may have post2cat entries with the old cat_ID if this is an update
- $cat_ID = apply_filters('cat_id_filter', $cat_ID, $update);
-
- clean_category_cache($cat_ID);
if ($update) {
do_action('edit_category', $cat_ID);
@@ -152,6 +149,10 @@ function wp_insert_category($catarr) {
do_action('add_category', $cat_ID);
}
+ $cat_ID = apply_filters('cat_id_filter', $cat_ID, $update);
+
+ clean_category_cache($cat_ID);
+
return $cat_ID;
}
diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php
index 7a33aca..4f90c28 100644
--- a/wp-admin/admin-functions.php
+++ b/wp-admin/admin-functions.php
@@ -2090,11 +2090,11 @@ function wp_generate_attachment_metadata( $attachment_id, $file ) {
$metadata['hwstring_small'] = "height='$uheight' width='$uwidth'";
$metadata['file'] = $file;
- if ( $metadata['width'] * $metadata['height'] < 3 * 1024 * 1024 ) {
- if ( $metadata['width'] > 128 && $metadata['width'] >= $metadata['height'] * 4 / 3 )
- $thumb = wp_create_thumbnail($file, 128);
- elseif ( $metadata['height'] > 96 )
- $thumb = wp_create_thumbnail($file, 96);
+ $max = apply_filters( 'wp_thumbnail_creation_size_limit', 3 * 1024 * 1024, $attachment_id, $file );
+
+ if ( $max > 0 && $metadata['width'] * $metadata['height'] < $max ) {
+ $max_side = apply_filters( 'wp_thumbnail_max_side_length', 128, $attachment_id, $file );
+ $thumb = wp_create_thumbnail( $file, $max_side );
if ( @file_exists($thumb) )
$metadata['thumb'] = basename($thumb);
diff --git a/wp-admin/link-import.php b/wp-admin/link-import.php
index 9f1e0c0..6484dbb 100644
--- a/wp-admin/link-import.php
+++ b/wp-admin/link-import.php
@@ -26,7 +26,7 @@ switch ($step) {
<form enctype="multipart/form-data" action="link-import.php" method="post" name="blogroll">
<?php wp_nonce_field('import-bookmarks') ?>
-<p><?php _e('If a program or website you use allows you to export your links or subscriptions as OPML you may import them here.'); ?>
+<p><?php _e('If a program or website you use allows you to export your links or subscriptions as OPML you may import them here.'); ?></p>
<div style="width: 70%; margin: auto; height: 8em;">
<input type="hidden" name="step" value="1" />
<input type="hidden" name="MAX_FILE_SIZE" value="30000" />
diff --git a/wp-admin/options-discussion.php b/wp-admin/options-discussion.php
index 51b3122..5791bc0 100644
--- a/wp-admin/options-discussion.php
+++ b/wp-admin/options-discussion.php
@@ -70,7 +70,7 @@ include('admin-header.php');
</fieldset>
<fieldset class="options">
<legend><?php _e('Comment Blacklist') ?></legend>
-<p><?php _e('When a comment contains any of these words in its content, name, URL, e-mail, or IP, it will be deleted. One word or IP per line. It will match inside words, so "press" will match "WordPress".') ?></p>
+<p><?php _e('When a comment contains any of these words in its content, name, URL, e-mail, or IP, it will be marked as spam. One word or IP per line. It will match inside words, so "press" will match "WordPress".') ?></p>
<p>
<textarea name="blacklist_keys" cols="60" rows="4" id="blacklist_keys" style="width: 98%; font-size: 12px;" class="code"><?php form_option('blacklist_keys'); ?></textarea>
</p>
diff --git a/wp-admin/upgrade-functions.php b/wp-admin/upgrade-functions.php
index ce4e62c..87249f9 100644
--- a/wp-admin/upgrade-functions.php
+++ b/wp-admin/upgrade-functions.php
@@ -517,10 +517,12 @@ function upgrade_210() {
foreach ( $posts as $post )
wp_schedule_single_event(mysql2date('U', $post->post_date), 'publish_future_post', array($post->ID));
}
+
if ( $wp_current_db_version < 3570 ) {
// Create categories for link categories if a category with the same
// name doesn't exist. Create a map of link cat IDs to cat IDs.
- $link_cats = $wpdb->get_results("SELECT cat_id, cat_name FROM $wpdb->linkcategories");
+ $link_cat_id_map = array();
+ $link_cats = $wpdb->get_results("SELECT cat_id, cat_name FROM " . $wpdb->prefix . 'linkcategories');
foreach ( $link_cats as $link_cat) {
if ( $cat_id = category_exists($link_cat->cat_name) ) {
$link_cat_id_map[$link_cat->cat_id] = $cat_id;
@@ -534,9 +536,13 @@ function upgrade_210() {
// Associate links to cats.
$links = $wpdb->get_results("SELECT link_id, link_category FROM $wpdb->links");
if ( !empty($links) ) foreach ( $links as $link ) {
+ if ( 0 == $link->link_category )
+ continue;
+ if ( ! isset($link_cat_id_map[$link->link_category]) )
+ continue;
$link_cat = $link_cat_id_map[$link->link_category];
$cat = $wpdb->get_row("SELECT * FROM $wpdb->link2cat WHERE link_id = '$link->link_id' AND category_id = '$link_cat'");
- if (!$cat && 0 != $link->link_category) {
+ if ( !$cat ) {
$wpdb->query("INSERT INTO $wpdb->link2cat (link_id, category_id)
VALUES ('$link->link_id', '$link_cat')");
}
@@ -553,6 +559,9 @@ function upgrade_210() {
$wpdb->query("UPDATE $wpdb->categories SET link_count = '$count' WHERE cat_ID = '$cat_id'");
}
}
+
+ // Obsolete linkcategories table
+ $wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'linkcategories');
}
}
diff --git a/wp-admin/upload-js.php b/wp-admin/upload-js.php
index 67d7a9e..bdf3d1c 100644
--- a/wp-admin/upload-js.php
+++ b/wp-admin/upload-js.php
@@ -56,7 +56,7 @@ addLoadEvent( function() {
this.currentImage.width = false;
this.currentImage.height = false;
}
- this.currentImage.isImage = ( 0 == id ? '' : $('attachment-is-image-' + id).value );
+ this.currentImage.isImage = ( 0 == id ? 0 : $('attachment-is-image-' + id).value );
this.currentImage.ID = id;
},
@@ -74,7 +74,7 @@ addLoadEvent( function() {
h += "<a href='#' onclick='return theFileList.cancelView();' title='<?php echo attribute_escape(__('Browse your files')); ?>' class='back'><?php echo attribute_escape(__('&laquo; Back')) ?></a>";
}
h += "<div id='file-title'>"
- if ( !this.currentImage.isImage )
+ if ( 0 == this.currentImage.isImage )
h += "<h2><a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='<?php echo attribute_escape(__('Direct link to file')); ?>'>" + this.currentImage.title + "</a></h2>";
else
h += "<h2>" + this.currentImage.title + "</h2>";
@@ -83,7 +83,7 @@ addLoadEvent( function() {
h += "</span>";
h += '</div>'
h += "<div id='upload-file-view' class='alignleft'>";
- if ( this.currentImage.isImage ) {
+ if ( 1 == this.currentImage.isImage ) {
h += "<a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='<?php echo attribute_escape(__('Direct link to file')); ?>'>";
h += "<img src='" + ( this.currentImage.thumb ? this.currentImage.thumb : this.currentImage.src ) + "' alt='" + this.currentImage.title + "' width='" + this.currentImage.width + "' height='" + this.currentImage.height + "' />";
h += "</a>";
@@ -152,7 +152,7 @@ addLoadEvent( function() {
h += "<a href='#' onclick='return theFileList.cancelView();' title='<?php echo attribute_escape(__('Browse your files')); ?>' class='back'><?php echo attribute_escape(__('&laquo; Back')); ?></a>";
}
h += "<div id='file-title'>"
- if ( !this.currentImage.isImage )
+ if ( 0 == this.currentImage.isImage )
h += "<h2><a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='<?php echo attribute_escape(__('Direct link to file')); ?>'>" + this.currentImage.title + "</a></h2>";
else
h += "<h2>" + this.currentImage.title + "</h2>";
@@ -161,7 +161,7 @@ addLoadEvent( function() {
h += "</span>";
h += '</div>'
h += "<div id='upload-file-view' class='alignleft'>";
- if ( this.currentImage.isImage ) {
+ if ( 1 == this.currentImage.isImage ) {
h += "<a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='<?php echo wp_specialchars(__('Direct link to file')); ?>'>";
h += "<img src='" + ( this.currentImage.thumb ? this.currentImage.thumb : this.currentImage.src ) + "' alt='" + this.currentImage.title + "' width='" + this.currentImage.width + "' height='" + this.currentImage.height + "' />";
h += "</a>";
@@ -230,7 +230,7 @@ addLoadEvent( function() {
displayEl = $A(document.forms.uploadoptions.elements.display).detect( function(i) { return i.checked; } )
if ( displayEl )
display = displayEl.value;
- else if ( this.currentImage.isImage )
+ else if ( 1 == this.currentImage.isImage )
display = 'full';
if ( 'none' != link )