My plugin needs to introduce a number of interfaces to Wordpress for the public traffic. What is the best way of introducing new interfaces?
Believe it or not the WordPress official documentation has a great page covering this topic called Administration Menus. It also provides example code on how to use Wordpress hooks in your plugin code to add custom setting pages and other pages like that.
The page can be found here. Fire up the kettle and make yourself a coffee or tea before reading, because it is quite a large page. It even covers things like adding in forms and saving settings for your plugin that you can access.
** Update **
After further understanding what you were asking, it's apparent you want to create a Wordpress page from within your plugin, not an admin screen. Depending on whether or not you want to create it upon activation or when a user does a particular thing I'll assume you want to create it upon activation and remove it upon deactivation.
I did not add in code for deleting pages, you should be able to work that part out though. The following should add in a page upon activation of your plugin.
If you have any questions or issues using the sample code post up what you're trying to accomplish and someone will sort you out. Good luck.
I'm not sure that Dwayne's answer on how to create a WordPress "Page" is what the poster is looking for. Here are some disadvantages of creating a WordPress Page.
Based on the poster's desire for "interfaces to WordPress", I'm going to assume Am01 wants to create a "page" (lower-case), not a WordPress "Page"--ie, just some arbitrary PHP creating arbitrary HTML.
I had the same this problem. I needed a callback URL for an OAuth login sequence. Also, I wanted to create a self-contained test-bed page for my Plugin. Here is how I did it:
This is unofficial! One reason it is a hack is it hard-codes the location of
But I couldn't find an official or cleaner way to do this. If someone has one, I'd be grateful for it!