I am trying to set up a shortcode within kfunctions.php so that a video can be embedded into a post. The problem I am facing is that it uses javasript for the embed. Is there a way to make this embed link work as a shortcode?
Functions code:
- Code: Select all
<script type='text/javascript' src='http://KMIR.images.worldnow.com/interface/js/WNVideo.js?rnd=851976;hostDomain=www.kmir.com;playerWidth=645;playerHeight=360;isShowIcon=true;clipId=11724499;flvUri=;partnerclipid=;adTag=Station%25201;advertisingZone=;enableAds=true;landingPage=;islandingPageoverride=false;playerType=STANDARD_EMBEDDEDscript;controlsType=overlay'></script><a href="http://www.kmir.com" title="KMIR News | Palm Springs, California">KMIR News | Palm Springs, California</a>
Functions code:
- Code: Select all
<?php
$FUNCS->register_shortcode( 'embed', 'embed_handler' );
function embed_handler( $params, $content=null ){
global $FUNCS;
extract( $FUNCS->get_named_vars(array(
'code' => '',
), $params) );
return $code;
}