Skip to content

Factories reboot #2093

@acobster

Description

@acobster

Is your feature request related to a problem? Please describe.

The requirements for Factories has changed a lot since the long discussion on #1793 and #1219 :

  • Factories will no longer be exposed publicly. They will constitute a completely internall API to be used by the Timber\Timber class.
  • Instead of exposing Factories externally, we're exposing a small set of filters that will be used inside Factories to instantiate the correct class for a given post type, taxonomy, etc.
  • The requirements for Factories is now being driven by the new API proposal for Timber::get_posts() and friends.

Goals

The goals for implementing Factories are:

  • To provide a centralized layer for instantiating Timber\Core instances (Post, Term, etc.) and their corresponding collection classes (e.g. PostCollection).
  • To eventually replace PostGetter etc., to be called directly from Timber::get_* methods (e.g. ::get_posts).
  • To provide a centralized place to implement filters like timber/post/classmap as described in the Class Map proposal.
  • To incorporate the best ideas from WIP: Feature/interfaced object factories #1793 and Object factory usage #1219 in a way that matches up with the new API proposal

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions