HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: /var/www/html/insiders/wp-load/wp-content/plugins/gutenmate/lib/proxy.php
<?php

/*
These are a proxy functions to call functions in the Gutenmate plugin if activated
 */

function gtm_build_query_vars_from_query_block( $block, $page ) {
	if ( function_exists( 'gutenberg_build_query_vars_from_query_block' ) ) {
		return gutenberg_build_query_vars_from_query_block( $block, $page );
	} else {
		return build_query_vars_from_query_block( $block, $page );
	}
}

/**
 * Get file system object for reading/writing file
 */
function gtm_get_wp_filesystem() {
	require_once ABSPATH . 'wp-admin/includes/file.php';
	global $wp_filesystem;
	WP_Filesystem();

	return $wp_filesystem;
}

function gtm_get_file_content( $file ) {
	$wp_filesystem = gtm_get_wp_filesystem();

	// Return content or null if not exists
	if ( file_exists( $file ) && is_readable( $file ) ) {
		return $wp_filesystem->get_contents( $file );
	}
}