<?php
/**
 * Options Page Builder — public integration loader.
 *
 * @package OptionsPageBuilder
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Load frontend/public integrations (shortcode, REST, builders, Gutenberg).
 */
function wpps_opb_load_public_integrations(): void {
	static $loaded = false;
	if ( $loaded ) {
		return;
	}

	$dir = __DIR__;
	$files = [
		'shortcode.php',
		'content-tags.php',
		'rest-api.php',
		'gutenberg.php',
		'divi.php',
		'beaver-themer.php',
	];

	foreach ( $files as $file ) {
		$path = $dir . '/' . $file;
		if ( is_readable( $path ) ) {
			require_once $path;
		}
	}

	$loaded = true;
}
