You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@montagmorgens Can you provide more details on your use case? The factory is just meant to make post queries, I'd like to have more context before considering making factory protected.
@nlemoine Our use case is to include children posts with post_status private. Since there's no filter hook which would allow us to change the query in the children() method, we tried to override the method.
We could probably provide a better solution to update the query by using a filter or adding an optional parameter with query parameters that overwrite the default ones. A pull request would be welcome.
Expected Behavior
When extending a Timber\Post, I should be able to access the factory() method.
I'm trying to override the children() method which needs to have access to the factory.
Actual behavior
Timber\Post::factory() is private and cannot be accessed by inhertitance.
Steps to reproduce behavior
Notes
No response
What version of Timber are you using?
Timber 2.0
What version of WordPress are you using?
WordPress 6.4.2
What version of PHP are you using?
PHP 8.1
How did you install Timber?
Installed or updated Timber through Composer
The text was updated successfully, but these errors were encountered: