passing markup thought a shortcode attribute

You have quite a bit of markup for that shortcode. Trying to pass all of that as a shortcode is going to be trouble. I pulled it apart to look at it. id=”map” z=”11″ w=”100%” h=”300″ scrollwheel=”false” maptype=”ROADMAP” address=”Southampton, United Kingdom” marker=”true” markerimage=”http://anachronistic.local:9102/wp-content/plugins/_TomRush/inc/js/TinyMCE_additions/modal/../img/icons/music_folk_map.png“ infowindow=”<div class=”marker inside”><img class=”marker icon” alt=”” src=”http://maps.gstatic.com/mapfiles/place_api/icons/geocode-71.png” /><strong>Southampton</strong><br>Southampton, UK<br><span class=”marker extras”>Some User … Read more

Custom youtube shortcode that uses $content

Shortcode functions accept a second parameter which contains the value in between the shortcode opening and closing tags: function youtube( $atts, $value=”http://” ) { extract( shortcode_atts( array( “width” => ‘620’, “height” => ‘350’, “name”=> ‘movie’, “allowFullScreen” => ‘true’, “allowScriptAccess”=>’always’, ), $atts ) ); return ‘<object style=”height: ‘.$height.’px; width: ‘.$width.’px”><param name=”‘.$name.'” value=”‘.$value.'”><param name=”allowFullScreen” value=”‘.$allowFullScreen.'”></param><param name=”allowScriptAccess” value=”‘.$allowScriptAccess.'”></param><embed … Read more

do_shortcode doesn’t work on some pages

global $options;$fields;$options2;$options3;$symbols; That is the same as: global $options; $fields; $options2; $options3; $symbols; You’ve declared options as a global, but the other variables are just stated, they’re doing nothing, those lines might as well not be there. Next we have: $fields = get_post_meta($post->ID, ‘mod1′, true); But you’re not checking if it’s an error value. if … Read more

Displaying audio player as preview in audio post in WP3.6

You missed the src part. It should have been: Go on the Shortcode section of the Audio / Video support in Core post. $post_content=”lorem ipsum dolor lorem ipsum “; if( preg_match( ‘#\#s’, $post_content, $matches ) && preg_match(“https://wordpress.stackexchange.com/”([^”]+)”https://wordpress.stackexchange.com/”, $matches[0], $m) ){ echo $m[1]; // echoes http://wpthemetestdata.files.wordpress.com/2008/06/originaldixielandjazzbandwithalbernard-stlouisblues.mp3 //set as featured } The first regex will get your … Read more

Displaying shortcode output through Options Framework

You should check out the WordPress function do_shortcode(). You can use it to generate the shortcodes, in a string variable, like this : <?php echo do_shortcode( $content ) ?> So in your case, please try: <?php if ( of_get_option(‘footer_contact_form’) ) { echo do_shortcode( of_get_option(‘footer_contact_form’) ); } ?>

Get attributes of nested shortcodes

Since nobody posted a complete answer, I used the method s_ha_dum described and written a function that returns a shortcode => attributes array/map. function attribute_map($str, $att = null) { $res = array(); $reg = get_shortcode_regex(); preg_match_all(‘~’.$reg.’~’,$str, $matches); foreach($matches[2] as $key => $name) { $parsed = shortcode_parse_atts($matches[3][$key]); $parsed = is_array($parsed) ? $parsed : array(); if(array_key_exists($name, $res)) … Read more

How do I make a shortcode?

Like this: add_shortcode(‘SHORTCODE_NAME’, ‘SHORTCODE_NAME_shortcode’); function SHORTCODE_NAME_shortcode() { // PUT YOUR CODE HERE } Then you can just do [SHORTCODE_NAME] and whatever is in the SHORTCODE_NAME_shortcode() function will do its thing.