I am attempting to write down my first caption plugin and having some difficulties.
I am establishing a shortcode like so:
operate Shortcode_Caption( $atts, $content material=null ){
// DEFAULT ARGUMENTS ARRAY
$args=shortcode_atts( array(
'caption' => 'Caption',
'hyperlink' => 'http://www.hyperlink.com'
), $atts);
// ENCLOSED SHORTCODES
if($content material){
return '<div class="Container-Caption"
alt="'. $args['caption'] .'"
rel="'. $args['link'] .'">
'.$content material.'</div>';
};
};
add_shortcode( 'Caption', 'Shortcode_Caption' );
Some JS picks it up from there. So then when the shortcode is used:
[Caption caption="This is the Text" link="http://www.go_here.com"]some content material[/Caption]
The above does not work, due to the areas within the “caption” attribute. Nevertheless, eradicating the areas works 100%:
[Caption caption="Text" link="http://www.go_here.com"]some content material[/Caption]
I am unsure what I am doing fallacious with this?
Thanks!