0

i am trying to get a rough idea about how Wordpress renders the final content, built-in and plugin content. Rendering means to me, manipulating direct or indirect(delay via ajax,..) the DOM.

To keep things and this question simple and short, how far would be Wordpress away from this rough pipe illustrated below:

Render pass 1:

  • cms content gets through the core
  • core queues client resources (head & body)
  • print (as temp. variable)

Render pass 2:

  • tags gets resolved (recursively ? where ?)
  • plugin queues client resources
  • print (as temp. variable?)

Final pass (is here one?)

  • all tags have been resolved and are ready for final composition, calculate body
  • head, resource cleanup (remove unneeded css, etc..)

  • more resource loading from client after final print,...

I am also interested to know whether Wordpress could act as virtual renderer only, by grabbing variables only for instance (tag results). Sunday detours: for instance in a 'piped' VPL (vm-less :-) you'd typically start with a block at the top and then inject the pipes(wires) down to the bottom with whatever fancy stuff like a parameter operation or filter (plugins). In that very world, how would the wp render pipe would look like? probably like an awesome tree...

however, the numbers say, there are 2500+ global functions and 2 hundred classes around to keep all working and I hope i can reproduce the entire rendering with a few commands only, can I? If anyone is interested to write that sequence down, please :-)

thanks for any hints.

1 Answer 1

3

Unlike many other frameworks there isn't much “pipeline” in WordPress.

You can see the fancy illustration for the load process, but basically:

  1. URL is resolved into query variables
  2. Query runs to fetch posts and determine context
  3. Template file is determined from the context
  4. Template file is included and has complete control over output from there (mostly using template tags functions and retrieving data from global variables like main query)

So the “pipeline” in a nutshell is — whatever template spits out is your page.

1
  • thanks for the fancy pic, that helps. ok, i can't really isolate that print from multiple instances, what a pity. Commented Oct 19, 2014 at 21:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.