-
-
Notifications
You must be signed in to change notification settings - Fork 513
Update ::get_post() and ::get_posts() signature #2090
Copy link
Copy link
Closed
Labels
Description
Is your feature request related to a problem? Please describe.
Per #2073 we are disabling direct instantiation of Posts and forcing all
Describe the solution you’d like
Update Timber::get_post()
Update the method signature to:
public static function get_post( $query = false );This gets rid of the second argument, $PostClass, whose functionality will be subsumed (much more nicely!) by Class Maps.
Update Timber::get_posts()
Update the method signature to:
public static function get_posts( array $query = [], array $options = [] );This also eliminates the $PostClass param as above, and consolidates Timber-specific options into a single array. Note that both are optional. This method will behave more or less the same as it has within archive templates.
Alternatives and context
- Upgrade guide proposal
- Timber 2.0 Context Guide proposal
- Class Maps
- Posts API in Timber 2.0 proposal
- More discussion: 2.x Documentation for API #2073 WIP: Feature/interfaced object factories #1793
Additional context
Reactions are currently unavailable