Ticket #16478: 16478-better.diff
File 16478-better.diff, 4.1 KB (added by , 11 years ago) |
---|
-
wp-admin/includes/post.php
1122 1122 1123 1123 list($permalink, $post_name) = get_sample_permalink($post->ID, $new_title, $new_slug); 1124 1124 1125 if ( 'publish' == $post->post_status ) { 1126 $ptype = get_post_type_object($post->post_type); 1127 $view_post = $ptype->labels->view_item; 1128 $title = __('Click to edit this part of the permalink'); 1129 } else { 1130 $title = __('Temporary permalink. Click to edit this part.'); 1131 } 1132 1125 $title = ( 'publish' == $post->post_status ) ? __('Click to edit this part of the permalink') : __('Temporary permalink. Click to edit this part.'); 1126 1133 1127 if ( false === strpos($permalink, '%postname%') && false === strpos($permalink, '%pagename%') ) { 1134 1128 $return = '<strong>' . __('Permalink:') . "</strong>\n" . '<span id="sample-permalink">' . $permalink . "</span>\n"; 1135 1129 if ( '' == get_option( 'permalink_structure' ) && current_user_can( 'manage_options' ) && !( 'page' == get_option('show_on_front') && $id == get_option('page_on_front') ) ) 1136 1130 $return .= '<span id="change-permalinks"><a href="options-permalink.php" class="button" target="_blank">' . __('Change Permalinks') . "</a></span>\n"; 1137 if ( isset($view_post) )1138 $return .= "<span id='view-post-btn'><a href='$permalink' class='button' target='_blank'>$view_post</a></span>\n";1139 1131 1140 1132 $return = apply_filters('get_sample_permalink_html', $return, $id, $new_title, $new_slug); 1141 1133 … … 1158 1150 1159 1151 $post_name_html = '<span id="editable-post-name" title="' . $title . '">' . $post_name_abridged . '</span>'; 1160 1152 $display_link = str_replace(array('%pagename%','%postname%'), $post_name_html, $permalink); 1161 $view_link = str_replace(array('%pagename%','%postname%'), $post_name, $permalink);1162 1153 $return = '<strong>' . __('Permalink:') . "</strong>\n"; 1163 1154 $return .= '<span id="sample-permalink">' . $display_link . "</span>\n"; 1164 1155 $return .= '‎'; // Fix bi-directional text display defect in RTL languages. 1165 1156 $return .= '<span id="edit-slug-buttons"><a href="#post_name" class="edit-slug button hide-if-no-js" onclick="editPermalink(' . $id . '); return false;">' . __('Edit') . "</a></span>\n"; 1166 1157 $return .= '<span id="editable-post-name-full">' . $post_name . "</span>\n"; 1167 if ( isset($view_post) )1168 $return .= "<span id='view-post-btn'><a href='$view_link' class='button' target='_blank'>$view_post</a></span>\n";1169 1158 1170 1159 $return = apply_filters('get_sample_permalink_html', $return, $id, $new_title, $new_slug); 1171 1160 -
wp-admin/js/post.dev.js
554 554 new_title: $('#title').val(), 555 555 samplepermalinknonce: $('#samplepermalinknonce').val() 556 556 }, function(data) { 557 $('# edit-slug-box').html(data);557 $('#sample-permalink-wrap').html(data); 558 558 b.html(revert_b); 559 559 real_slug.attr('value', new_slug); 560 560 makeSlugeditClickable(); -
wp-admin/edit-form-advanced.php
248 248 </div> 249 249 <div class="inside"> 250 250 <?php 251 $sample_permalink_html = ! empty( $post_type_object->publicly_queryable ) ? get_sample_permalink_html($post->ID) : ''; 251 $sample_permalink_html = ! empty( $post_type_object->publicly_queryable ) ? '<span id="sample-permalink-wrap">' . get_sample_permalink_html($post->ID) . '</span>' : ''; 252 $sample_permalink_html .= "<span id='view-post-btn'><a href='" . get_permalink( $post_ID ). "' class='button' target='_blank'>{$post_type_object->labels->view_item}</a></span>\n"; 253 252 254 $shortlink = wp_get_shortlink($post->ID, 'post'); 253 255 if ( !empty($shortlink) ) 254 256 $sample_permalink_html .= '<input id="shortlink" type="hidden" value="' . esc_attr($shortlink) . '" /><a href="#" class="button" onclick="prompt('URL:', jQuery(\'#shortlink\').val()); return false;">' . __('Get Shortlink') . '</a>';