How to get custom page template being edited in gutenberg editor

Question

I want to know custom page template name (the one chosen in page attributes – template) in PHP, before page opens in order to enqueue additional scripts according to chosen template.
I know how to get this information in javascript admin frontend part, however it would be more convenient if I could get it in PHP.

0
, , , , Lovor 5 months 0 Answers 55 views 0

Leave an answer