$args Data for the template, available to it as $args. */ public static function render( string $name, array $args ): string { $file = locate_template( self::THEME_FOLDER . '/' . $name . '.php' ); if ( '' === $file ) { $file = Plugin::path( 'templates/' . $name . '.php' ); } ob_start(); load_template( $file, false, $args ); return (string) ob_get_clean(); } }