[wp-hackers] The problem with WP_Rewrite <<< RE: Options for Controller - Views

Jacob Santos wordpress at santosj.name
Sun Nov 29 18:36:04 UTC 2009


Actually, I think a compromise can be done that would solve my problems, 
be acceptable to add to WordPress now, and be simple. Quite simply, my 
argument is that there are too many actions that must be done and going 
slightly along the lines of the example earlier, I believe that it is 
possible to create a single function which encompasses the WP_rewrite 
rule addition, flushing the rules if needed, setting up the WP_Query, 
query, and executing a callback for the controller.

I believe that by adding this function that encompasses everything a 
person needs, it will be more rigid, but will be incredible simple to 
use and learn. Also, if the person wants to dive further into the 
WP_Rewrite and WP_Query for setting up their own advanced processes, 
then a function will exist to hold their hand along the way.

I will still investigate rewriting the components, so that WordPress is 
not needed to run and thus should speed up the controller parts when 
WordPress is not needed for certain views. Also, This function could be 
done in a few days time, provided I worked on it in a few days time. I'm 
not going to, because it is going to take hours to understand how 
WP_Rewrite and WP_Query work again and getting it to work. Then I'll 
need to create the function to set everything up correctly.

Furthermore, this should allow for forwards compatibility with the new 
code, when it is coded. The function that is called to do all of it 
won't change. I think I can actually live with this solution for my 
project with the advantage of avoid fixing the "problem" at a later date.

Also, it will only serve as a router and will only work with WP_Query to 
setup the correct view to load. I won't work with custom post types, 
that will still have to use the old way.

Jacob Santos


More information about the wp-hackers mailing list