Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // By Clifford Paulick of http://tourkick.com/
- //
- // RESULTS IN SETTING http://siteurl.com/1234 AS THE SHORTLINK
- //
- // MAKE SURE YOU ENABLE THESE LINKS TO WORK VIA SOME METHOD, like http://managewp.com/?p=377184
- //
- function post_id_shortlink() {
- global $post;
- if ( is_singular() ) {
- $postid = $post->ID;
- $idshortlink = site_url() . '/' . $postid;
- return $idshortlink;
- }
- }
- add_filter( 'pre_get_shortlink', 'post_id_shortlink', 99); // priority 99 overrides bit.ly and other plugin's default priority of 10
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement