I am developing a plugin where Admin can integrate the plugin to a page where newly added products will be shown.. So, let's say user add the plugin to a page named my-page
.
So, the main content of the plugin will be shown in mysite.com/my-page/
Users can upload products and their uploaded products will be shown in
mysite.com/my-page/user/user-name
The admin will have the ability to add custom fields to the products. If admin create a custom field named category
, mysite.com/my-page/category/category-name
will show all the products with the category
, category-name
. All the pages will also have pagination support to restrict products per page. So, I need to create a rewrite rule on fly, every time Admin create a new custom field.
I know how to rewrite URL and add custom query variables but in this case I don't know the page name where it will be inserted and custom fields will be inserted in the database. So, basically I need dynamic URL rewriting. Is this kind of rewrite possible?