[wp-hackers] find wp-config from a plugin file

Otto otto at ottodestruct.com
Wed Jan 30 17:15:55 GMT 2008


Including wp-blog-header.php does not produce any output at all unless
you have WP_USE_THEMES defined to be true.

Including wp-config.php directly means that the Loop will not be
initialized properly, and a lot of functionality won't be called
correctly if you're running something in the wp-admin directory. This
latter part probably means little to a plugin, I grant you, but if you
want it to get the normal posts Loop, you need to include
wp-blog-header.php, not wp-config.php.

wp-blog-header.php is basically the starting point for all of
WordPress. Starting with wp-config.php skips bits.


On Jan 30, 2008 10:21 AM, Omry Yadan <omry at yadan.net> wrote:
> because it works fine.
>
> I was not even aware of wp-blog-header.php, and looking at it, I`d say
> that it might have some unexpected output I`d rather avoid.
>
>
> Otto wrote:
>
> > Why are you requiring wp-config.php? You should be requiring
> > wp-blog-header.php if you want to load the WordPress functionality.
>
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list