What could cause an object not be passed down included files?

Hello,

In wordpress: index.php


<?php
	
require_once 'Test/Test.php';
$test = new Test();

<?php get_template_part( 'main' ); ?>
?>


For a reason I don’t understand, I have to re-include and re-instantiate Test() in main.php.

Shouldn’t the class be available everywhere?

Cheers.

:slight_smile:

What does your class or function do? That could be the reason.