views:

24

answers:

2

Hi, I am currently in the process of making a WordPress Plugin which is going to parse some external data (products) from various web services and present them as normal pages in WordPress.

I would like to avoid actually creating the pages programatically and instead just generate them on the fly to avoid any synchronization issues if a product is deleted and so forth.

My plugin is going to have a base url in which it will hook on to, for example /products/, and then I would generate each product page by calling /products/some-product-name/. I also anticipate the need for uri's like /products/category/some-category-name/ which I will use to list all items in that category.

Since I am new to WordPress plugin development, I am looking for some tips and advice to get me started on the right foot. Any help is highly appreciated ;)

+1  A: 

I suppose it really depends on where/how you're getting your info from these web services, but I can imagine that the easiest way would be to setup a page as a controller and have it parse out some RSS or XML to build these "virtual pages" by request, so that you're not storing anything in the DB and if the info requested doesn't exist than yes 404 it.

hsatterwhite
A: 

I solved this by adding a filter to rewrite_rules_array and an action catching template_redirect.

Fini