From 659852f4d4a6da8a8147d4fe73cd55a4e83d2264 Mon Sep 17 00:00:00 2001 From: donncha Date: Thu, 21 Sep 2006 10:47:51 +0000 Subject: WP Merge to rev 4201 git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@763 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-includes/default-filters.php | 3 +++ wp-includes/functions.php | 32 +++++++++++++++++++++++++++++++- wp-includes/post.php | 6 +++--- wp-includes/rewrite.php | 2 +- 4 files changed, 38 insertions(+), 5 deletions(-) (limited to 'wp-includes') diff --git a/wp-includes/default-filters.php b/wp-includes/default-filters.php index 22b5528..75f24ed 100644 --- a/wp-includes/default-filters.php +++ b/wp-includes/default-filters.php @@ -141,6 +141,8 @@ add_filter('the_author', 'ent2ncr', 8); // Misc filters add_filter('option_ping_sites', 'privacy_ping_filter'); add_filter('option_blog_charset', 'wp_specialchars'); +add_filter('mce_plugins', '_mce_load_rtl_plugin'); +add_filter('mce_buttons', '_mce_add_direction_buttons'); // Actions add_action('wp_head', 'rsd_link'); @@ -158,4 +160,5 @@ add_action('do_pings', 'do_all_pings', 10, 1); add_action('do_robots', 'do_robots'); add_action('sanitize_comment_cookies', 'sanitize_comment_cookies'); add_action('admin_print_scripts', 'wp_print_scripts', 20); +add_action('mce_options', '_mce_set_direction'); ?> diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 1401b7b..1bd1487 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1131,6 +1131,12 @@ function wp_die($message, $title = '') { if ( empty($title) ) $title = __('WordPress › Error'); + + if ( strstr($_SERVER['PHP_SELF'], 'wp-admin') ) + $logo_src = 'images/wordpress-logo.png'; + else + $logo_src = 'wp-admin/images/wordpress-logo.png'; + ?> @@ -1176,7 +1182,7 @@ function wp_die($message, $title = '') { -

WordPress

+

WordPress

@@ -1185,4 +1191,28 @@ function wp_die($message, $title = '') { die(); } +function _mce_set_direction() { + global $wp_locale; + if ('rtl' == $wp_locale->text_direction) + echo 'directionality : "rtl" ,'; +} + +function _mce_load_rtl_plugin($input) { + global $wp_locale; + if ('rtl' == $wp_locale->text_direction) + $input[] = 'directionality'; + + return $input; +} + +function _mce_add_direction_buttons($input) { + global $wp_locale; + if ('rtl' == $wp_locale->text_direction) { + $new_buttons = array('separator', 'ltr', 'rtl'); + $input = array_merge($input, $new_buttons); + } + + return $input; +} + ?> diff --git a/wp-includes/post.php b/wp-includes/post.php index 468ed37..1968714 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -591,13 +591,13 @@ function wp_insert_post($postarr = array()) { if ( 'draft' != $post_status ) { $post_name_check = $wpdb->get_var("SELECT post_name FROM $wpdb->posts WHERE post_name = '$post_name' AND post_type = '$post_type' AND ID != '$post_ID' AND post_parent = '$post_parent' LIMIT 1"); - if ($post_name_check) { + if ($post_name_check || in_array($post_name, $wp_rewrite->feeds) ) { $suffix = 2; - while ($post_name_check) { + do { $alt_post_name = $post_name . "-$suffix"; $post_name_check = $wpdb->get_var("SELECT post_name FROM $wpdb->posts WHERE post_name = '$alt_post_name' AND post_type = '$post_type' AND ID != '$post_ID' AND post_parent = '$post_parent' LIMIT 1"); $suffix++; - } + } while ($post_name_check); $post_name = $alt_post_name; } } diff --git a/wp-includes/rewrite.php b/wp-includes/rewrite.php index 75445f8..6f34b57 100644 --- a/wp-includes/rewrite.php +++ b/wp-includes/rewrite.php @@ -97,7 +97,7 @@ function url_to_postid($url) { $url = str_replace('://www.', '://', $url); // Strip 'index.php/' if we're not using path info permalinks - if ( false === strpos($rewrite, 'index.php/') ) + if ( !$wp_rewrite->using_index_permalinks() ) $url = str_replace('index.php/', '', $url); if ( false !== strpos($url, get_option('home')) ) { -- cgit