<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[34670] trunk/src/wp-admin: Edit: Remove the redundant "View Post" button-link and link the sample permalink.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/34670">34670</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/34670","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>helen</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2015-09-28 20:09:19 +0000 (Mon, 28 Sep 2015)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Edit: Remove the redundant "View Post" button-link and link the sample permalink.
Previously there were two persistent "View Post" links on an edit screen: next to the permalink and in the toolbar. This would then become three links after a post was published or updated, as a link is also included in the admin notice. This is a lot of redundancy and visual noise for a flow that is not your primary action upon starting to edit a post. The "View Post" link next to the sample permalink was particularly bad because it is styled like a button, but unlike a button, does not keep you on the current screen.
Because the permalink is now linked, there is no highlighted slug that you can click to edit, but rather just the "Edit" button.
props scribu, lessbloat, sabreuse, SergeyBiryukov, DrewAPicture, helen.
see <a href="https://core.trac.wordpress.org/ticket/18306">#18306</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadmincsseditcss">trunk/src/wp-admin/css/edit.css</a></li>
<li><a href="#trunksrcwpadminincludespostphp">trunk/src/wp-admin/includes/post.php</a></li>
<li><a href="#trunksrcwpadminjspostjs">trunk/src/wp-admin/js/post.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadmincsseditcss"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/css/edit.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/css/edit.css 2015-09-28 19:29:22 UTC (rev 34669)
+++ trunk/src/wp-admin/css/edit.css 2015-09-28 20:09:19 UTC (rev 34670)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -113,11 +113,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> #editable-post-name {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- background-color: #fffbcc;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ font-weight: bold;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> #editable-post-name input {
</span><span class="cx" style="display: block; padding: 0 10px"> font-size: 13px;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ font-weight: normal;
</ins><span class="cx" style="display: block; padding: 0 10px"> height: 22px;
</span><span class="cx" style="display: block; padding: 0 10px"> margin: 0;
</span><span class="cx" style="display: block; padding: 0 10px"> width: 16em;
</span></span></pre></div>
<a id="trunksrcwpadminincludespostphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/post.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/post.php 2015-09-28 19:29:22 UTC (rev 34669)
+++ trunk/src/wp-admin/includes/post.php 2015-09-28 20:09:19 UTC (rev 34670)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1287,19 +1287,35 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> list($permalink, $post_name) = get_sample_permalink($post->ID, $new_title, $new_slug);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $view_link = false;
+ $preview_target = '';
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( current_user_can( 'read_post', $post->ID ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $ptype = get_post_type_object( $post->post_type );
- $view_post = $ptype->labels->view_item;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( 'draft' === $post->post_status ) {
+ $draft_link = set_url_scheme( get_permalink( $post->ID ) );
+ $view_link = get_preview_post_link( $post, array(), $draft_link );
+ $preview_target = " target='wp-preview-{$post->ID}'";
+ } else {
+ if ( 'publish' === $post->post_status ) {
+ $view_link = get_permalink( $post );
+ } else {
+ // Allow non-published (private, future) to be viewed at a pretty permalink.
+ $view_link = str_replace( array( '%pagename%', '%postname%' ), $post->post_name, urldecode( $permalink ) );
+ }
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'publish' == get_post_status( $post ) ) {
- $title = __('Click to edit this part of the permalink');
- } else {
- $title = __('Temporary permalink. Click to edit this part.');
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Permalinks without a post/page name placeholder don't have anything to edit
+ if ( false === strpos( $permalink, '%postname%' ) && false === strpos( $permalink, '%pagename%' ) ) {
+ $return = '<strong>' . __( 'Permalink:' ) . "</strong>\n";
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( false === strpos( $permalink, '%postname%' ) && false === strpos( $permalink, '%pagename%' ) ) {
- $return = '<strong>' . __('Permalink:') . "</strong>\n" . '<span id="sample-permalink" tabindex="-1">' . $permalink . "</span>\n";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( false !== $view_link ) {
+ $return .= '<a id="sample-permalink" href="' . esc_url( $view_link ) . '"' . $preview_target . '>' . $permalink . "</a>\n";
+ } else {
+ $return .= '<span id="sample-permalink">' . $permalink . "</span>\n";
+ }
+
+ // Encourage a pretty permalink setting
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( '' == get_option( 'permalink_structure' ) && current_user_can( 'manage_options' ) && !( 'page' == get_option('show_on_front') && $id == get_option('page_on_front') ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $return .= '<span id="change-permalinks"><a href="options-permalink.php" class="button button-small" target="_blank">' . __('Change Permalinks') . "</a></span>\n";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1318,34 +1334,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $post_name_html = '<span id="editable-post-name" title="' . $title . '">' . $post_name_abridged . '</span>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_name_html = '<span id="editable-post-name">' . $post_name_abridged . '</span>';
</ins><span class="cx" style="display: block; padding: 0 10px"> $display_link = str_replace( array( '%pagename%', '%postname%' ), $post_name_html, urldecode( $permalink ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $return = '<strong>' . __( 'Permalink:' ) . "</strong>\n";
- $return .= '<span id="sample-permalink" tabindex="-1">' . $display_link . "</span>\n";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $return = '<strong>' . __( 'Permalink:' ) . "</strong>\n";
+ $return .= '<span id="sample-permalink"><a href="' . esc_url( $view_link ) . '"' . $preview_target . '>' . $display_link . "</a></span>\n";
</ins><span class="cx" style="display: block; padding: 0 10px"> $return .= '‎'; // Fix bi-directional text display defect in RTL languages.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $return .= '<span id="edit-slug-buttons"><a href="#post_name" class="edit-slug button button-small hide-if-no-js" onclick="editPermalink(' . $id . '); return false;">' . __( 'Edit' ) . "</a></span>\n";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $return .= '<span id="edit-slug-buttons"><button type="button" class="edit-slug button button-small hide-if-no-js">' . __( 'Edit' ) . "</button></span>\n";
</ins><span class="cx" style="display: block; padding: 0 10px"> $return .= '<span id="editable-post-name-full">' . $post_name . "</span>\n";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( isset( $view_post ) ) {
- if ( 'draft' == $post->post_status || 'pending' == $post->post_status ) {
- $draft_link = set_url_scheme( get_permalink( $post->ID ) );
- $preview_link = get_preview_post_link( $post, array(), $draft_link );
- $return .= "<span id='view-post-btn'><a href='" . esc_url( $preview_link ) . "' class='button button-small' target='wp-preview-{$post->ID}'>$view_post</a></span>\n";
- } else {
- if ( 'publish' === $post->post_status ) {
- // View Post button should always go to the saved permalink.
- $pretty_permalink = get_permalink( $post );
- } else {
- // Allow non-published (private, future) to be viewed at a pretty permalink.
- $pretty_permalink = str_replace( array( '%pagename%', '%postname%' ), $post->post_name, urldecode( $permalink ) );
- }
-
- $return .= "<span id='view-post-btn'><a href='" . $pretty_permalink . "' class='button button-small'>$view_post</a></span>\n";
- }
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filter the sample permalink HTML markup.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span></span></pre></div>
<a id="trunksrcwpadminjspostjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/js/post.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/js/post.js 2015-09-28 19:29:22 UTC (rev 34669)
+++ trunk/src/wp-admin/js/post.js 2015-09-28 20:09:19 UTC (rev 34670)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -210,7 +210,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> sticky = '',
</span><span class="cx" style="display: block; padding: 0 10px"> $textarea = $('#content'),
</span><span class="cx" style="display: block; padding: 0 10px"> $document = $(document),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $editSlugWrap = $('#edit-slug-box'),
</del><span class="cx" style="display: block; padding: 0 10px"> postId = $('#post_ID').val() || 0,
</span><span class="cx" style="display: block; padding: 0 10px"> $submitpost = $('#submitpost'),
</span><span class="cx" style="display: block; padding: 0 10px"> releaseLock = true,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -723,25 +722,30 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // permalink
</span><span class="cx" style="display: block; padding: 0 10px"> function editPermalink() {
</span><span class="cx" style="display: block; padding: 0 10px"> var i, slug_value,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ e, revert_e,
</ins><span class="cx" style="display: block; padding: 0 10px"> c = 0,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- e = $('#editable-post-name'),
- revert_e = e.html(),
</del><span class="cx" style="display: block; padding: 0 10px"> real_slug = $('#post_name'),
</span><span class="cx" style="display: block; padding: 0 10px"> revert_slug = real_slug.val(),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- b = $('#edit-slug-buttons'),
- revert_b = b.html(),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ permalink = $( '#sample-permalink' ),
+ permalinkOrig = permalink.html(),
+ permalinkInner = $( '#sample-permalink a' ).html(),
+ buttons = $('#edit-slug-buttons'),
+ buttonsOrig = buttons.html(),
</ins><span class="cx" style="display: block; padding: 0 10px"> full = $('#editable-post-name-full');
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Deal with Twemoji in the post-name
</span><span class="cx" style="display: block; padding: 0 10px"> full.find( 'img' ).replaceWith( function() { return this.alt; } );
</span><span class="cx" style="display: block; padding: 0 10px"> full = full.html();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $('#view-post-btn').hide();
- b.html('<a href="#" class="save button button-small">'+postL10n.ok+'</a> <a class="cancel" href="#">'+postL10n.cancel+'</a>');
- b.children('.save').click(function() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ permalink.html( permalinkInner );
+ e = $('#editable-post-name');
+ revert_e = e.html();
+
+ buttons.html('<button type="button" class="save button-small">'+postL10n.ok+'</button> <a class="cancel" href="#">'+postL10n.cancel+'</a>');
+ buttons.children('.save').click(function() {
</ins><span class="cx" style="display: block; padding: 0 10px"> var new_slug = e.children('input').val();
</span><span class="cx" style="display: block; padding: 0 10px"> if ( new_slug == $('#editable-post-name-full').text() ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- b.children('.cancel').click();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ buttons.children('.cancel').click();
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $.post(ajaxurl, {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -759,18 +763,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- b.html(revert_b);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ buttons.html(buttonsOrig);
+ permalink.html(permalinkOrig);
</ins><span class="cx" style="display: block; padding: 0 10px"> real_slug.val(new_slug);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $('#view-post-btn').show();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $( '.edit-slug' ).focus();
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- b.children('.cancel').click(function() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ buttons.children('.cancel').click(function() {
</ins><span class="cx" style="display: block; padding: 0 10px"> $('#view-post-btn').show();
</span><span class="cx" style="display: block; padding: 0 10px"> e.html(revert_e);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- b.html(revert_b);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ buttons.html(buttonsOrig);
+ permalink.html(permalinkOrig);
</ins><span class="cx" style="display: block; padding: 0 10px"> real_slug.val(revert_slug);
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $( '.edit-slug' ).focus();
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -784,11 +791,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> var key = e.keyCode || 0;
</span><span class="cx" style="display: block; padding: 0 10px"> // on enter, just save the new slug, don't save the post
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 13 == key ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- b.children('.save').click();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ buttons.children('.save').click();
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 27 == key ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- b.children('.cancel').click();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ buttons.children('.cancel').click();
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> } ).keyup( function() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -796,16 +803,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }).focus();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $editSlugWrap.length ) {
- $editSlugWrap.on( 'click', function( event ) {
- var $target = $( event.target );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $('#edit-slug-box').on( 'click', '.edit-slug', function() {
+ editPermalink();
+ });
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $target.is('#editable-post-name') || $target.hasClass('edit-slug') ) {
- editPermalink();
- }
- });
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> wptitlehint = function(id) {
</span><span class="cx" style="display: block; padding: 0 10px"> id = id || 'title';
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre>
</div>
</div>
</body>
</html>