__()
, _x()
, _n()
and _nx()
in your Twig files, just like you would do use them in your PHP files.<button role="button" aria-label="{{ __('My Label', 'my-text-domain') }}">
works just like you would expect.We cannot get twig function {{ dump(record) }}
to work, possibly because DEBUG is not set to true, which is not configured the way WP normally does because in this case we use Azure/Docker (for a reason, long story).
So, how can I check on the frontend whether debug is true?
if ( defined( 'WP_DEBUG' ) && true === WP_DEBUG ) {
TimberHelper::function_wrapper( 'pc_debug' );
}
function pc_debug( $some ) {
PC::debug( $some );
}