WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Link to Post] Shortcode instead of URL? (1 post)

  1. randyhoyt
    Member
    Posted 5 years ago #

    I love the interface for adding links to posts and pages! But there's one huge potential issue that can be overcome with a shortcode. (I'm happy to write the shortcode if you want to modify the interface to use it.)

    Problem
    ----
    If you need to change the URL of a page, all the old links created with this plugin will break. For example, I once had to change a page from this ...

    * domain.com/books/index-to-issue-1-100/

    ... to this:

    * domain.com/books/index-to-issue-1-110/

    Solution
    ----
    This can be solved with a shortcode. Instead of using this URL, you could use a shortcode:

    <a href="[link_to_post id=174]">Link label</a>

    The shortcode can generate the current permalink for the page or post; if that permalink changes, the link would still be correct.

    What do you think? I'm happy to write the shortcode if you want to modify the interface to use it. You may even want to add it as a configuration option: "[ ] Use shortcode instead of absolute URL"

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.