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/themes/breadly/lib/util.php
<?php

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

	return $wp_filesystem;
}

/**
 * Register block pattern from template part
 * Arguments is the same as `register_block_pattern()`
 * but the `$pattern_properties['content']` must be a Template unique identifier (example: theme_slug//template_slug)
 */
function gtmt_register_block_pattern( $pattern_name, $pattern_properties ) {
	if ( ! empty( $pattern_properties['content'] ) ) {
		$block_template = get_block_template( $pattern_properties['content'], 'wp_template_part' );

		if ( $block_template ) {
			$pattern_properties['content'] = $block_template->content;

			return register_block_pattern( $pattern_name, $pattern_properties );
		}

	}

	return false;
}