filchos
Forum Replies Created
-
Forum: Plugins
In reply to: [Subscribe to Double-Opt-In Comments] many notices version 6.4.8Same to me.
WordPress 4.2.2
php 5.5.16
Error reporting 32767Forum: Hacks
In reply to: Same query_vars, but different SQL request between main loop and Wp_QueryThank you for your explanations, bcworkz!
Now I understand better twice: How it works and how awkward WordPress’ internals are.
Forum: Hacks
In reply to: Same query_vars, but different SQL request between main loop and Wp_QueryThank you for your help, bcworkz!
Sometimes WordPress is hard to understand since it’s kind of quaint sometimes.
Just one case:
query_varsof the current main loop contain bothnameandpagenamewithout any problem in the main loop.If I set these vars in the constructor of an own request I would expect the same result. But
post_typewill be set topostinstead. Only when I remove thenamevar it works as excepted. I had similar cases with the varspandpage_idcausing the same problem.What I don’t understand: The main loop uses a
Wp_Queryinstance as well (the globalwp_query), but when I try to mimic the behaviour by constructing a Wp_Query instance that looks alike to me I get a different behaviour. Somehow the main loop must have another initialisation process as my code, but I didn’t find a clue, neither in the WordPress documentation, nor by checking the code itself.There are heaps of loop and Wp_Query related functions and methods initialising, setting up, building objects, destroy object, reset the pointer and so one but I didn’t come up to a working combination.