wp_get_shortlink() improvements.

* Return shortlinks for pages and public CPTs.
* Return shortlinks even when cruft-free links are not enabled.
* Unit tests

Props sillybean, layotte, cais
fixes #18632
see #14760


Built from https://develop.svn.wordpress.org/trunk@25030


git-svn-id: http://core.svn.wordpress.org/trunk@25017 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Only set and run internal search for linking selected text if the panel is open. Make sure the focus is in the URL field whenever opening the linking modal to preserve previous behavior. props greuben. fixes #16276.

Built from https://develop.svn.wordpress.org/trunk@25031


git-svn-id: http://core.svn.wordpress.org/trunk@25018 1a063a9b-81f0-0310-95a4-ce76da25c4cd