[wp-testers] Re: wp-testers Digest, Vol 21, Issue 14

Peter Westwood peter.westwood at ftwr.co.uk
Sun Nov 12 21:39:21 GMT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ajay D'Souza wrote:
> I was using the information from the codex itself.
> 
> I got it to work. One thing I found out is that if get_bloginfo is called
> inside a function then it works perfectly.
> 
> If it is outside the functions, then it throws up an error.
> 

Is this in your plugin code.

Are you trying to call get_bloginfo when your plugin in 'included'?

You should run all your initialisation code in a function called on the
'plugins_loaded' or 'init' hooks to ensure that all the wordpress global
variables are setup.

>> > I was using the function get_bloginfo('rss2_url') in a plugin. But I
>> get
>> > this error:
>> >
>> > *Fatal error*: Call to a member function on a non-object in *
>> > /home/adcom/public_html/wp-includes/template-functions-links.php* on
>> line
>> > *
>> > 185*
>> >
>> > The linke 185 in template-functions-links.php is  $permalink =
>> > $wp_rewrite->get_feed_permastruct();
>> >
>> > template-functions-links.php has been added in 2.0.5 I believe, because
>> I
>> > couldn't find it in my installation of 2.0.4
>> >
>> > How do I find out the rss2_url if this doesn't work?
>> >

$wp_rewrite is no created till after the plugins are included so if you
call it as your plugin is included this will fail as described above.

westi
- --
Peter Westwood
http://blog.ftwr.co.uk
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFV5SJVPRdzag0AcURAvQPAJsF11OklsPvmiMFr6gKcoFwk7uBgwCeIhs1
xCpKSB3cwyKT5zaHvnIDSuU=
=cNAo
-----END PGP SIGNATURE-----


More information about the wp-testers mailing list