Skip to content

Update ::get_post() and ::get_posts() signature #2090

@acobster

Description

@acobster

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

Additional context

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions