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/breadly/load.php
<?php

/*//////////////////////////////////////
// Load Modules
//////////////////////////////////////*/

include_once GTM_DIR . 'settings/settings.php';
include_once GTM_DIR . 'settings/settings-page.php';
include_once GTM_DIR . 'settings/user-profile-page.php';
include_once GTM_DIR . 'lib/load.php';
include_once GTM_DIR . 'block-library/blocks.php';
include_once GTM_DIR . 'block-extensions/header-sticky.php';
include_once GTM_DIR . 'block-extensions/core-blocks.php';
include_once GTM_DIR . 'block-extensions/core-image.php';
include_once GTM_DIR . 'block-extensions/core-gallery.php';
include_once GTM_DIR . 'block-extensions/core-query.php';
include_once GTM_DIR . 'block-extensions/core-query-pagination-numbers.php';
include_once GTM_DIR . 'block-extensions/core-query-pagination-next.php';
include_once GTM_DIR . 'block-extensions/core-query-pagination-previous.php';
include_once GTM_DIR . 'block-extensions/core-quote.php';
include_once GTM_DIR . 'block-extensions/core-navigation.php';
include_once GTM_DIR . 'block-extensions/core-site-logo.php';
include_once GTM_DIR . 'block-extensions/post-options.php';
include_once GTM_DIR . 'block-supports/block-visibility.php';
include_once GTM_DIR . 'block-supports/flexbox-child.php';
include_once GTM_DIR . 'block-supports/block-style.php';
include_once GTM_DIR . 'block-supports/block-props.php';
include_once GTM_DIR . 'block-supports/line-clamp.php';
include_once GTM_DIR . 'block-supports/use-web-fonts.php';
include_once GTM_DIR . 'block-supports/footer-content.php';

include_once GTM_DIR . 'block-extensions/block-id.php';
include_once GTM_DIR . 'block-extensions/block-printing.php';

/*//////////////////////////////////////
// Load Plugin Text Domain
//////////////////////////////////////*/

add_action( 'plugins_loaded', 'gtm_load_textdomain' );
function gtm_load_textdomain() {
	load_plugin_textdomain( 'gutenmate', FALSE, GTM_DIR . '/languages' );
}

/*//////////////////////////////////////
// Register assets
//////////////////////////////////////*/

add_action( 'init', 'gtm_setup_assets' );
function gtm_setup_assets() {
	wp_register_style( 'gutenmate-plugin', GTM_URL . 'assets/css/plugin.css', [], GTM_VERSION );
}

/**
 * Locate core template for overriden from child theme
 * Usage: gtm_locate_template( 'template-parts/posts/post-box.php' );
 */

function gtm_locate_template( $file ) {
	$theme_file = get_theme_file_path( $file );

	if ( file_exists( $theme_file ) ) {
		return $theme_file;
	} else {
		return GTM_DIR . $file;
	}
}

/*//////////////////////////////////////
// Register supported theme features
//////////////////////////////////////*/

/**
 * Theme feature: Image sizes
 */

add_action( 'setup_theme', 'gtm_register_theme_feature_image_sizes', 0 );
function gtm_register_theme_feature_image_sizes() {
	register_theme_feature( 'gutenmate-image-sizes', [
		'type'         => 'array',
		'description'  => esc_html__( 'Image sizes to be registered. These image sizes can be managed in gutenmate.', 'gutenmate' ),
		'show_in_rest' => [
			'schema' => [
				'type'  => 'array',
				'items' => [
					'type'       => 'object',
					'properties' => [
						'enable' => ["type" => 'boolean'],
						'name'   => ["type" => 'string'],
						'width'  => ["type" => 'number'],
						'height' => ["type" => 'number'],
						'crop'   => ["type" => 'boolean'],
						'cropX'  => ["type" => 'string'],
						'cropY'  => ["type" => 'string'],
					],
				],
			],
		],
	] );
}

/**
 * Theme feature: Spacing
 * For theme developer, Use `settings.spacing.spacingSizes` in `theme.json` instead.
 * Example CSS Output:
 * --gtm--space--3xl: 72px;
 * --gtm--space--4xl: 80px;
 */

add_action( 'setup_theme', 'gtm_register_theme_feature_spacing', 0 );
function gtm_register_theme_feature_spacing() {
	register_theme_feature( 'gutenmate-spacing', [
		'type'         => 'array',
		'description'  => esc_html__( 'Image sizes to be registered. These image sizes can be managed in gutenmate.', 'gutenmate' ),
		'show_in_rest' => [
			'schema' => [
				'type'  => 'array',
				'items' => [
					'type'       => 'object',
					'properties' => [
						'name' => ["type" => 'string'],
						'slug' => ["type" => 'string'],
						'size' => ["type" => 'string'],
					],
				],
			],
		],
	] );
}

/**
 * Theme feature: Font families
 * Example CSS Output:
 * --gtm--font-family--headline: 'Oswald'
 */

add_action( 'setup_theme', 'gtm_register_theme_feature_font_families', 0 );
function gtm_register_theme_feature_font_families() {
	register_theme_feature( 'gutenmate-font-families', [
		'type'         => 'array',
		'description'  => esc_html__( 'Font families to be registered with automatic loading google fonts.', 'gutenmate' ),
		'show_in_rest' => [
			'schema' => [
				'type'  => 'array',
				'items' => [
					'type'       => 'object',
					'properties' => [
						'name'              => ["type" => 'string'],
						'slug'              => ["type" => 'string'],
						'fontFamily'        => ["type" => 'string'],
						'preloadFontWeight' => [
							"type"        => 'string',
							'description' => esc_html__( 'Font weight to be preloaded. Use comma for multiple weights. Ex. "300,400,400i".', 'gutenmate' ),
						],
					],
				],
			],
		],
	] );
}

/**
 * Theme feature: Typography preset
 * Example CSS Output:
 * --gtm--typography--heading-1--font-family: 'Oswald';
 * --gtm--typography--heading-2x--font-size: '30px';
 */

add_action( 'setup_theme', 'gtm_register_theme_feature_typography', 0 );
function gtm_register_theme_feature_typography() {
	register_theme_feature( 'gutenmate-typography', [
		'type'         => 'array',
		'description'  => esc_html__( 'Typography preset to be registered.', 'gutenmate' ),
		'show_in_rest' => [
			'schema' => [
				'type'  => 'array',
				'items' => [
					'type'       => 'object',
					'properties' => [
						'name'           => ["type" => 'string'],
						'slug'           => ["type" => 'string'],
						'font-family'    => ["type" => 'string'],
						/* Font weight and style, For italic use '400i' */
						'font-weight'    => ["type" => 'string'],
						'font-size'      => [
							"type"       => ['string', 'object'],
							'properties' => [
								'sm' => ["type" => 'string'],
								'md' => ["type" => 'string'],
								'lg' => ["type" => 'string'],
							],
						],
						'line-height'    => [
							"type"       => ['string', 'object'],
							'properties' => [
								'sm' => ["type" => 'string'],
								'md' => ["type" => 'string'],
								'lg' => ["type" => 'string'],
							],
						],
						'letter-spacing' => [
							"type"       => ['string', 'object'],
							'properties' => [
								'sm' => ["type" => 'string'],
								'md' => ["type" => 'string'],
								'lg' => ["type" => 'string'],
							],
						],
						'text-transform' => ["type" => 'string'],
					],
				],
			],
		],
	] );
}

/**
 * Theme feature: Generate typography presets for headings automatically
 */

add_action( 'setup_theme', 'gtm_register_theme_feature_auto_heading_presets', 0 );
function gtm_register_theme_feature_auto_heading_presets() {
	register_theme_feature( 'gutenmate-auto-heading-presets', [
		'type'         => 'boolean',
		'description'  => esc_html__( 'Generate typography presets for headings automatically.', 'gutenmate' ),
		'show_in_rest' => [
			'schema' => [
				'type'    => 'boolean',
				'default' => false,
			],
		],
	] );
}

/**
 * Theme feature: Theme information
 */

add_action( 'setup_theme', 'gtm_register_theme_feature_theme_info', 0 );
function gtm_register_theme_feature_theme_info() {
	register_theme_feature( 'gutenmate-theme-info', [
		'type'         => 'object',
		'description'  => esc_html__( 'Add theme information.', 'gutenmate' ),
		'show_in_rest' => [
			'schema' => [
				'type'       => 'object',
				'properties' => [
					'docUrl'       => ["type" => 'string'],
					'logoUrl'      => ["type" => 'string'],
					'thumbnailUrl' => ["type" => 'string'],
				],
			],
		],
	] );
}

/**
 * Generate heading presets for Gutenmate from settings in theme.json
 * To activate this process, call `add_theme_support( 'gutenmate-auto-heading-presets' )`
 */
add_action( 'after_setup_theme', 'gtm_do_auto_heading_presets', 99 );
function gtm_do_auto_heading_presets() {
	if ( current_theme_supports( 'gutenmate-auto-heading-presets' ) ) {
		$themeJson = WP_Theme_JSON_Resolver::get_theme_data()->get_raw_data();

		// No settings to be created
		if ( empty( $themeJson ) || empty( $themeJson['styles']['elements'] ) ) {
			return;
		}

		$elements = $themeJson['styles']['elements'];

		$support = [
			[
				'name'           => esc_html__( 'Heading 1', 'gutenmate' ),
				'slug'           => 'heading-1',
				'font-family'    => $elements['heading']['typography']['fontFamily'] ?? $elements['h1']['typography']['fontFamily'] ?? null,
				'font-weight'    => $elements['heading']['typography']['fontWeight'] ?? $elements['h1']['typography']['fontWeight'] ?? null,
				'font-size'      => $elements['heading']['typography']['fontSize'] ?? $elements['h1']['typography']['fontSize'] ?? null,
				'line-height'    => $elements['heading']['typography']['lineHeight'] ?? $elements['h1']['typography']['lineHeight'] ?? null,
				'letter-spacing' => $elements['heading']['typography']['letterSpacing'] ?? $elements['h1']['typography']['letterSpacing'] ?? null,
				'text-transform' => $elements['heading']['typography']['textTransform'] ?? $elements['h1']['typography']['textTransform'] ?? null,
			],
			[
				'name'           => esc_html__( 'Heading 2', 'gutenmate' ),
				'slug'           => 'heading-2',
				'font-family'    => $elements['heading']['typography']['fontFamily'] ?? $elements['h2']['typography']['fontFamily'] ?? null,
				'font-weight'    => $elements['heading']['typography']['fontWeight'] ?? $elements['h2']['typography']['fontWeight'] ?? null,
				'font-size'      => $elements['heading']['typography']['fontSize'] ?? $elements['h2']['typography']['fontSize'] ?? null,
				'line-height'    => $elements['heading']['typography']['lineHeight'] ?? $elements['h2']['typography']['lineHeight'] ?? null,
				'letter-spacing' => $elements['heading']['typography']['letterSpacing'] ?? $elements['h2']['typography']['letterSpacing'] ?? null,
				'text-transform' => $elements['heading']['typography']['textTransform'] ?? $elements['h2']['typography']['textTransform'] ?? null,
			],
			[
				'name'           => esc_html__( 'Heading 3', 'gutenmate' ),
				'slug'           => 'heading-3',
				'font-family'    => $elements['heading']['typography']['fontFamily'] ?? $elements['h3']['typography']['fontFamily'] ?? null,
				'font-weight'    => $elements['heading']['typography']['fontWeight'] ?? $elements['h3']['typography']['fontWeight'] ?? null,
				'font-size'      => $elements['heading']['typography']['fontSize'] ?? $elements['h3']['typography']['fontSize'] ?? null,
				'line-height'    => $elements['heading']['typography']['lineHeight'] ?? $elements['h3']['typography']['lineHeight'] ?? null,
				'letter-spacing' => $elements['heading']['typography']['letterSpacing'] ?? $elements['h3']['typography']['letterSpacing'] ?? null,
				'text-transform' => $elements['heading']['typography']['textTransform'] ?? $elements['h3']['typography']['textTransform'] ?? null,
			],
			[
				'name'           => esc_html__( 'Heading 4', 'gutenmate' ),
				'slug'           => 'heading-4',
				'font-family'    => $elements['heading']['typography']['fontFamily'] ?? $elements['h4']['typography']['fontFamily'] ?? null,
				'font-weight'    => $elements['heading']['typography']['fontWeight'] ?? $elements['h4']['typography']['fontWeight'] ?? null,
				'font-size'      => $elements['heading']['typography']['fontSize'] ?? $elements['h4']['typography']['fontSize'] ?? null,
				'line-height'    => $elements['heading']['typography']['lineHeight'] ?? $elements['h4']['typography']['lineHeight'] ?? null,
				'letter-spacing' => $elements['heading']['typography']['letterSpacing'] ?? $elements['h4']['typography']['letterSpacing'] ?? null,
				'text-transform' => $elements['heading']['typography']['textTransform'] ?? $elements['h4']['typography']['textTransform'] ?? null,
			],
			[
				'name'           => esc_html__( 'Heading 5', 'gutenmate' ),
				'slug'           => 'heading-5',
				'font-family'    => $elements['heading']['typography']['fontFamily'] ?? $elements['h5']['typography']['fontFamily'] ?? null,
				'font-weight'    => $elements['heading']['typography']['fontWeight'] ?? $elements['h5']['typography']['fontWeight'] ?? null,
				'font-size'      => $elements['heading']['typography']['fontSize'] ?? $elements['h5']['typography']['fontSize'] ?? null,
				'line-height'    => $elements['heading']['typography']['lineHeight'] ?? $elements['h5']['typography']['lineHeight'] ?? null,
				'letter-spacing' => $elements['heading']['typography']['letterSpacing'] ?? $elements['h5']['typography']['letterSpacing'] ?? null,
				'text-transform' => $elements['heading']['typography']['textTransform'] ?? $elements['h5']['typography']['textTransform'] ?? null,
			],
			[
				'name'           => esc_html__( 'Heading 6', 'gutenmate' ),
				'slug'           => 'heading-6',
				'font-family'    => $elements['heading']['typography']['fontFamily'] ?? $elements['h6']['typography']['fontFamily'] ?? null,
				'font-weight'    => $elements['heading']['typography']['fontWeight'] ?? $elements['h6']['typography']['fontWeight'] ?? null,
				'font-size'      => $elements['heading']['typography']['fontSize'] ?? $elements['h6']['typography']['fontSize'] ?? null,
				'line-height'    => $elements['heading']['typography']['lineHeight'] ?? $elements['h6']['typography']['lineHeight'] ?? null,
				'letter-spacing' => $elements['heading']['typography']['letterSpacing'] ?? $elements['h6']['typography']['letterSpacing'] ?? null,
				'text-transform' => $elements['heading']['typography']['textTransform'] ?? $elements['h6']['typography']['textTransform'] ?? null,
			],
		];

		$support = gtm_remove_null_values( $support );

		// Merge with existing presets
		if ( current_theme_supports( 'gutenmate-typography' ) ) {
			$support = array_merge( $support, get_theme_support( 'gutenmate-typography' )[0] );
		}

		// Update settings for Gutenmate
		add_theme_support( 'gutenmate-typography', $support );
	}
}