• Hi,

    I’m using this code into the file functions.php o a custom theme to create an object LabManager that defines all the custom taxonomies and the custom post types of this site.

    if ( ! class_exists( 'LabManager' ) ) {
    	include_once 'classes/class-labmanager.php';
    
    	global $lab_manager;
    	$lab_manager = new LabManager();
    	$lab_manager->plugin_setup();
    }

    Setting a breakpoint on the row “$lab_manager = new LabManager();” I can see that If a click on a page of the site it is called three times.

    Why this line into the functions.php file is called so many times?

    The post types work well, but I don’t like that the plugin_setup code is executed so many times.

    Thank yopu very much

    Claudio

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Why the code into functions.php is called many times?’ is closed to new replies.