• Resolved WP CMS Ninja

    (@billiardgreg)


    Is there a way to get the shortened permalink that is auto assigned to a specific post by using the post ID via PHP?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter WP CMS Ninja

    (@billiardgreg)

    So I didn’t want to wait around for the author to respond to the ticket so I decided to write my own. Maybe the author will have a better way but here is my solution.

    function get_pretty_link_url( $post_id ) {
        $pretty_link_id = get_post_meta($post_id, '_pretty-link', true);
        $url = prli_get_pretty_link_url($pretty_link_id);
        return $url;
    }

    Hope this helps other people.

    Krista

    (@kristathecoder)

    Yes, this is probably the easiest and most direct way to get the pretty link id from the post id.

    I’ve also put in a feature request with our development team to add a helper function for this to make it easier in the future.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Get Shortened Permalink Functionality’ is closed to new replies.