WordPress.org

Support

Support » Requests and Feedback » [Plugin: Link to Post] Shortcode instead of URL?

[Plugin: Link to Post] Shortcode instead of URL?

  • 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”

  • The topic ‘[Plugin: Link to Post] Shortcode instead of URL?’ is closed to new replies.
Skip to toolbar