From 3709397168df33a37c7c72a1221e232d1c1f364a Mon Sep 17 00:00:00 2001 From: azaozz Date: Mon, 14 Sep 2009 02:06:33 +0000 Subject: [PATCH] Explain that the permalink is temporary for autosave generated permalinks, fixes #7733 git-svn-id: http://svn.automattic.com/wordpress/trunk@11928 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/post.php | 16 ++++++++++------ wp-includes/script-loader.php | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index 0a633e49f..d699a06d4 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -920,7 +920,7 @@ function postbox_classes( $id, $page ) { * @param unknown_type $name * @return unknown */ -function get_sample_permalink($id, $title=null, $name = null) { +function get_sample_permalink($id, $title = null, $name = null) { $post = &get_post($id); if (!$post->ID) { return array('', ''); @@ -981,8 +981,13 @@ function get_sample_permalink($id, $title=null, $name = null) { function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) { $post = &get_post($id); list($permalink, $post_name) = get_sample_permalink($post->ID, $new_title, $new_slug); - if ( 'publish' == $post->post_status ) + + if ( 'publish' == $post->post_status ) { $view_post = 'post' == $post->post_type ? __('View Post') : __('View Page'); + $title = __('Click to edit this part of the permalink'); + } else { + $title = __('Temporary permalink. Click to edit this part.'); + } if ( false === strpos($permalink, '%postname%') && false === strpos($permalink, '%pagename%') ) { $return = '' . __('Permalink:') . "\n" . '' . $permalink . "\n"; @@ -996,15 +1001,14 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) { return $return; } - $title = __('Click to edit this part of the permalink'); - if (function_exists('mb_strlen')) { - if (mb_strlen($post_name) > 30) { + if ( function_exists('mb_strlen') ) { + if ( mb_strlen($post_name) > 30 ) { $post_name_abridged = mb_substr($post_name, 0, 14). '…' . mb_substr($post_name, -14); } else { $post_name_abridged = $post_name; } } else { - if (strlen($post_name) > 30) { + if ( strlen($post_name) > 30 ) { $post_name_abridged = substr($post_name, 0, 14). '…' . substr($post_name, -14); } else { $post_name_abridged = $post_name; diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 65023709a..abf2d0fbb 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -275,7 +275,7 @@ function wp_default_scripts( &$scripts ) { $scripts->add_data( 'slug', 'group', 1 ); $scripts->localize( 'slug', 'slugL10n', array( 'requestFile' => admin_url('admin-ajax.php'), - 'save' => __('Save'), + 'save' => __('OK'), 'cancel' => __('Cancel'), 'l10n_print_after' => 'try{convertEntities(slugL10n);}catch(e){};' ) );