• Resolved kryuko

    (@kryuko)


    Hello.
    We are developing a plugin that will require a lot of redirect, and we are thinking about requiring this plugin for redirect.

    We have seen that you have an import/export function with a csv.
    We would like to create a function in our plugin that, given an old and new url, will import the redirect in your plugin.

    We have looked at your import code but is huge. Is there a documentation about how to do this? Or maybe can you tell us how your import code works and/or wich DB tables we need to edit?

    Thank you in advance.

    – Kryuko

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author John Godley

    (@johnny5)

    Redirection uses the WordPress REST API, and you should be able to use it create and edit redirects – this is probably the best route. You can also directly create a redirect with Red_Item::create, although this is subject to change.

    The import feature is for importing a file, and not really for programmatic use.

    Thread Starter kryuko

    (@kryuko)

    Hello and thank you for the reply.

    Can you please tell me which file i need to look for your REST API code?

    Thank you in advance.

    Plugin Author John Godley

    (@johnny5)

    The API endpoints are described by accessing /wp-json/ on any site. If you have Redirection installed then it will appear in the list of supported endpoints, and describes all the available functions. There are WordPress functions to access this and create appropriate requests. The data format is described in the api directory in Redirection

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to use your plugin from another plugin?’ is closed to new replies.