Created
November 12, 2014 19:15
-
-
Save willybahuaud/67625e4331e0fc1fd826 to your computer and use it in GitHub Desktop.
This file contains 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
<?php | |
add_filter( 'get_sample_permalink_html', 'willy_filter_fake_permalink', 10, 4 ); | |
function willy_filter_fake_permalink( $return, $id, $newtitle, $newslug ) { | |
remove_filter( 'get_sample_permalink_html', 'willy_filter_fake_permalink' ); | |
if ( $newslug === NULL ) { | |
if ( 'post' == get_post_type( $id ) ) { | |
$return = preg_replace( "/id=\"editable-post-name\"([^>]*)>/", "id=\"editable-post-name\"$1>actualite-", $return ); | |
$return = preg_replace( "/id=\"editable-post-name-full\">/", "id=\"editable-post-name-full\">actualite-", $return ); | |
} | |
} | |
return $return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment