Hi everybody, having an odd problem with one of my plugins.
The plugin is designed to pull in ebay feeds. Here’s one of the functions.
function ebay_feeds_for_wordpress_notecho($dispurl = "", $dispnum = "") {
include_once(ABSPATH . WPINC . '/rss.php');
$link = get_option("ebay-feeds-for-wordpress-link");
if ($dispurl == "")
{
$dispurl = get_option('ebay-feeds-for-wordpress-default');
}
if ($dispnum == "")
{
$dispnum = get_option('ebay-feeds-for-wordpress-default-number');
}
/* ======================================== */
$display .= "FEED URL: " . $dispurl;
$disprss = fetch_feed($dispurl);
/* ======================================== */
$disprss_items = $disprss->get_items(0, $dispnum);
$display .= "<div class='ebayfeed'>";
foreach ($disprss_items as $dispitem ) {
$display .= "<h4><a href='".$dispitem->get_permalink()."'>".$dispitem->get_title()."</a></h4>";
$display .= $dispitem->get_description();
$display .= "<br/>Title: " . $dispitem->get_title();
}
$display .= "</div>";
if ($link == 1)
{
$display .= "<a href='http://bloggingdojo.com/wordpress-plugins/ebay-feeds-for-wordpress/'>eBay Feeds for WordPress</a> by <a href='http://www.bloggingdojo.com'>The Blogging Dojo</a><br/><br/>";
}
return $display;
}
Now, if $dispurl is empty, then the feed uses the default feed (call it http://www.feed1.com/). However, I am supplying a URL to this code (http://www.feed2.com/). When I run the code I get http://www.feed2.com/ shown in the first line highlighted (between the commented ==='s), yet the feed fetched is http://www.feed1.com/, with incorrect URL’s
I’m completely and utterly confused by it. Any ideas will be greatfully appreciated!
Cheers
Rhys