I use a custom post type “Event”. Attempting to list created posts of this post type with Bricks enabled in the Wordpress dashboard breaks with fatal error on allowed memory size. I have pushed the WP memory size to 1 GB and PHP limit is 2 GB. All plugins disabled, except the one that creates the custom post type.
Switching to a different theme fixes the problem (even with much smaller memory size limits)
The custom post type is registered with the following parameters:
Can you please explain how to replicate the issue? What I’ve done now, is to create the custom post type with the code (with the parameters that you posted), but now I’m not sure what you mean by that:
Please let me know, or record a video, and I’ll try to replicate it.
Hi Matej,
Thanks for your prompt reaction!
In the Wordpress dashboard you now have a menu item “Events”.
Create and publish one event and be sure to put some text in the excerpt.
Select All events in the Events menu. You will see the event just created in the list
Now modify the event and erase all text in the excerpt.
Select All events in the Events menu.
BANG:
Fatal error : Allowed memory size of 2147483648 bytes exhausted (tried to allocate 262144 bytes) in /Users/christer/Sites/sardignac-on-wine-bricks/www/wp-includes/cache.php on line 154
Fatal error : Allowed memory size of 2147483648 bytes exhausted (tried to allocate 262144 bytes) in /Users/christer/Sites/sardignac-on-wine-bricks/www/wp-includes/class-wp-fatal-error-handler.php on line 37
Hello Matej,
I have done some more investigations.
There are indeed some filter functions running and I have found where things break.
It is the following code line (in the custom plugin where the custom post type is defined)
When $post->post_excerpt returns an empty string this filter causes the problem when the Bricks theme is used.
I have tested switching to two different themes (2023 and Storefront) and with these things work OK.
Despite the fact that the problem only appears with Bricks, I suspect that the problem lies in the filter functions that may call each others recursively. I will look into this in detail, and if you don’t hear back from me, consider the problem solved.