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
I encountered a strange behavior with the Timber::get_post() function when attempting to call it from the admin panel. On some pages, I receive a \stdClass instead of the expected Post. Is this behavior expected, or is it still a bug?
What version of Timber are you using?
Timber 2.1
What version of WordPress are you using?
Wordpress 65
What version of PHP are you using?
PHP 8.2
How did you install Timber?
Installed or updated Timber through Composer
The text was updated successfully, but these errors were encountered:
RomanZhakhovTR
changed the title
[BUG] Timber::get_post() returns stdObject inseted of ?Post
[BUG] Timber::get_post() returns stdObject instead of ?Post
May 2, 2024
Can you provide an example on how you make those calls from the backend? Is it in a editor page or another page? Please post examples if working with such edge-cases so we can be of help.
Expected Behavior
Function call must return the null|Post data type according to the documentation
Actual behavior
In some cases I get an object of type \stdClass
object(stdClass)#4985 (2) { ["ID"]=> int(24685) ["post_parent"]=> int(0) }
Notes
I encountered a strange behavior with the Timber::get_post() function when attempting to call it from the admin panel. On some pages, I receive a \stdClass instead of the expected Post. Is this behavior expected, or is it still a bug?
What version of Timber are you using?
Timber 2.1
What version of WordPress are you using?
Wordpress 65
What version of PHP are you using?
PHP 8.2
How did you install Timber?
Installed or updated Timber through Composer
The text was updated successfully, but these errors were encountered: