From 9561db4dee15bd2d3559e0c3be4b498420420477 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 18 Jun 2014 00:28:35 +0000 Subject: [PATCH] Don't add # to URL when clicking 'OK' without changing the permalink. props avryl. fixes #27594. git-svn-id: https://develop.svn.wordpress.org/trunk@28771 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/js/post.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/js/post.js b/src/wp-admin/js/post.js index 21f28e7d5e..6c7d1b8602 100644 --- a/src/wp-admin/js/post.js +++ b/src/wp-admin/js/post.js @@ -892,7 +892,8 @@ jQuery(document).ready( function($) { b.children('.save').click(function() { var new_slug = e.children('input').val(); if ( new_slug == $('#editable-post-name-full').text() ) { - return $('#edit-slug-buttons .cancel').click(); + b.children('.cancel').click(); + return false; } $.post(ajaxurl, { action: 'sample-permalink', @@ -915,7 +916,7 @@ jQuery(document).ready( function($) { return false; }); - $('#edit-slug-buttons .cancel').click(function() { + b.children('.cancel').click(function() { $('#view-post-btn').show(); e.html(revert_e); b.html(revert_b);