sitecrafting / conifer

:evergreen_tree: A powerful WordPress library plugin for OO development
https://www.coniferplug.in
MIT License
18 stars 2 forks source link

get_context_with #94

Closed acobster closed 5 years ago

acobster commented 5 years ago

We have the get_context_with_post and get_context_with_posts helpers, but it'd be nice to have a helper for setting arbitrary data:

$data = $site->context([
  'post'   => new Post(),
  'thingy' => new Thingy(),
]);

This is more flexible and can subsume the get_context_with_post[s] methods, which should probably be deprecated.

Acceptance criteria: