HEX
Server: Apache
System: Linux sg2plzcpnl504304.prod.sin2.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: jouxfbe8ozk9 (9736628)
PHP: 8.0.30
Disabled: NONE
Upload Files
File: /home/jouxfbe8ozk9/public_html/wp-content/plugins/sitekit/inc/sitekit-shortcode-iframe.php
<?php

function sitekit_shortcode_iframe( $atts ) {
	$defaults = array(
		'src' => 'http://www.youtube.com/embed/4qsGTXLnmKs',
		'width' => '100%',
		'height' => '500',
		'scrolling' => 'yes',
		'frameborder' => '0'
	);

	foreach ( $defaults as $default => $value ) { // add defaults
		if ( ! @array_key_exists( $default, $atts ) ) { // mute warning with "@" when no params at all
			$atts[$default] = $value;
		}
	}

	// Remove srcdoc attribute if it exists
	if ( isset( $atts['srcdoc'] ) ) {
		unset( $atts['srcdoc'] );
	}

	$html = "\n".'<iframe';
	foreach( $atts as $attr => $value ) {
		// sanitize url
		if ( strtolower($attr) == 'src' ) {
			$value = esc_url( $value );
		}
		// remove all attributes starting with "on". Examples: onload, onmouseover, onfocus, onpageshow, onclick
		if ( strpos( strtolower( $attr ), 'on' ) !== 0 ) {
			if ( $value != '' ) {
				// adding all attributes
				$html .= ' ' . esc_attr( $attr ) . '="' . esc_attr( $value ) . '"';
			} else {
				// adding empty attributes
				$html .= ' ' . esc_attr( $attr );
			}
		}
	}
	$html .= '></iframe>'."\n";

	return $html . SITEKIT_PLUGIN_POWERED;
}
add_shortcode( 'sitekit_iframe', 'sitekit_shortcode_iframe' );