Quantcast
Channel: Topic Tag: xml | WordPress.org
Viewing all articles
Browse latest Browse all 3201

Dipak G. on "basic passing url through shortcode causing unusual problem"

$
0
0

Hi Sam,

You have to add line $str_format = str_replace(array(" & # 0 3 8 ;"," & a m p ;"), "&", $xmlurl); into your function to fix this.

Updated function :

function willhill_text($atts) {
	extract( shortcode_atts( array(
		"xmlurl"=>'http://'),
		$atts
		)
 	);

        // Remove spaces from " & # 0 3 8 ;"," & a m p ;"
 	$str_format = str_replace(array(" & # 0 3 8 ;"," & a m p ;"), "&", $xmlurl);

 	$rss = simplexml_load_file(esc_url_raw($str_format));
 	print_r($rss);
}
add_shortcode('willhill_text_link', 'willhill_text');

Pastie.org URL : http://pastie.org/private/hjtfgnqsbzfanfdhumemw

I hope this helps.

~ Dipak G.


Viewing all articles
Browse latest Browse all 3201

Trending Articles