Created
July 18, 2014 18:01
-
-
Save sapel/5f31aa4853cf073be82d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'get_sample_permalink_html', 't5_unabridge_sample_permalink', 10, 2 ); | |
| /** | |
| * Replaces the shortened permalink with its full form. | |
| * | |
| * @param string $sample Permalink HTML | |
| * @param int $id Post ID | |
| * @return string | |
| */ | |
| function t5_unabridge_sample_permalink( $sample, $id ) | |
| { | |
| $link = get_sample_permalink( $id ); | |
| $s1 = '<span id="editable-post-name" '; | |
| $s2 = '</span>'; | |
| return preg_replace( | |
| '~' . $s1 . '([^>]*)>([^<]*)' . $s2 . '~Ui', | |
| $s1 . '$1>' . $link[1] . $s2, | |
| $sample | |
| ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment