su_shortcode_document

The shortcodes-ultimate su shortcode document function.

Published Date - February 15, 2021

Description

su_shortcode_document( $atts, $content );

Parameters

  1. $atts

  2. $content


Usage

The following example is for adding a hook callback.

if ( !function_exists( 'su_shortcode_document' ) ) {
    require_once ABSPATH . PLUGINDIR . 'shortcodes-ultimateshortcodes-ultimate/includes/shortcodes/document.php';
}

// The input(s). 
$atts = null;
$content = null;

// NOTICE! Understand what this does before running.
$result = su_shortcode_document( $atts, $content );
            

Defined

The function is defined in the following location(s).

shortcodes-ultimate/includes/shortcodes/document.php

function su_shortcode_document( $atts = null, $content = null ) {
	$atts = shortcode_atts(
		array(
			'url'        => '',
			'file'       => null, // 3.x
			'width'      => 600,
			'height'     => 400,
			'responsive' => 'yes',
			'title'      => '',
			'class'      => '',
		),
		$atts,
		'document'
	);

	if ( null !== $atts['file'] ) {
		$atts['url'] = $atts['file'];
	}

	su_query_asset( 'css', 'su-shortcodes' );

	return '<div class="su-document su-u-responsive-media-' . $atts['responsive'] . '"><iframe src="//docs.google.com/viewer?embedded=true&url=' . $atts['url'] . '" width="' . $atts['width'] . '" height="' . $atts['height'] . '" class="su-document' . su_get_css_class( $atts ) . '" title="' . esc_attr( $atts['title'] ) . '"></iframe></div>';
}