public static function do_template( $code, $obj = null ) {

		if ( ! empty( $obj ) ) {
			self::$obj =& $obj;
		} else {
			$obj =& self::$obj;
		}

		if ( empty( $obj ) || ! is_object( $obj ) ) {
			return '';
		}

		$code = trim( $code );

		if ( false !== strpos( $code, '<?' ) && ( ! defined( 'PODS_DISABLE_EVAL' ) || ! PODS_DISABLE_EVAL ) ) {
			pods_deprecated( 'Pod Template PHP code has been deprecated, please use WP Templates instead of embedding PHP.', '2.3' );

			$code = str_replace( '$this->', '$obj->', $code );

			ob_start();

			eval( "?>$code" );

			$out = ob_get_clean();
		} else {
			$out = $code;
		}

		$out = $obj->do_magic_tags( $out );

		return apply_filters( 'pods_templates_do_template', $out, $code, $obj );
	}