• Hi Guys,

    Installed wordpress for the first time today. ??

    I need to create a wordpress plugging that provides CRUD capability to a remote API. Would someone be able to point me in the right direction on this please, maybe a good tutorial or where I can read up on the best way to do this.

    I know how to create a plugin, but I don’t know how to create custom html pages to display the remote content and build edit forms etc…

    Thank you very much ??

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Welcome to the WordPress community! FYI, it’s important to get the letter cases correct in WordPress ??

    OK, it’s not that important, but it is a “thing“.

    The main challenge in creating custom code pages is initializing the WP environment so you can make use of WP resources in your code. The easiest option is to create a custom page template. An explanation of this and other options, as well as how many are doing it wrong, is available here. Its focus is mainly on a method not very well known, but it does explain how the wrong ways really are a problem though they seem to work.

    Unfortunately, page templates are for themes, not plugins. There are workarounds though. If you do not need your template to be visible to end users, the workaround is simple enough. You add a page based on the default template so that there is a permalink you can use to access your code page. You then add the path to the actual template file in postmeta under the key _wp_page_template.

    Now when that page is requested, the code on your template will execute. If one of the other methods sounds like it would work better for you, by all means go for it. Seeing that templates are really for themes, the admin-post.php approach has a lot of appeal.

Viewing 1 replies (of 1 total)
  • The topic ‘Creating CRUD plugin for word from external API’ is closed to new replies.