• If you want to use ‘wp_get_shortlink($postID)’ to Show YOUR small URL then use the code below .. It swaps the LONG permalink for the wp_get_shortlink if your using another shortening plugin like YOURLS for example.

    NEXTSCRIPTS, please make an option to use this. I have YOURLS plugin make shortlinks for me and it stores it in a way that I can access it through wp_get_shortlink. Can I have an option to use that instead. Your option keeps recreating it everytime its republished and I don’t know how to access it to show on my post page.

    Page – NextScripts_SNAP.php
    Line – 1791 (or just search the code for that line below)

    // Use wp_get_shortlink($postID) to Show my SMALL URL!
      // Old Line below kepy for backup purposes
      //if (preg_match('%URL%', $msg)) { $url = get_permalink($postID); if($addURLParams!='') $url .= (strpos($url,'?')!==false?'&':'?').$addURLParams;  $nxs_urlLen = nxs_strLen($url); $msg = str_ireplace("%URL%", $url, $msg);}
    
    // New Line below uses wp_get_shortlink instead or permalink. Make sure your wp_get_shortlink works 1st before you do this.
      if (preg_match('%URL%', $msg)) { $url = wp_get_shortlink($postID); if($addURLParams!='') $url .= (strpos($url,'?')!==false?'&':'?').$addURLParams;  $nxs_urlLen = nxs_strLen($url); $msg = str_ireplace("%URL%", $url, $msg);}
      // Use wp_get_shortlink($postID) to Show my SMALL URL!

    http://wordpress.org/plugins/social-networks-auto-poster-facebook-twitter-g/

  • The topic ‘Use your short url in msg with – wp_get_shortlink’ is closed to new replies.