[wp-hackers] wp-config.php, wp-load.php, and ABSPATH

Stephen Rider wp-hackers at striderweb.com
Tue Sep 15 04:26:23 UTC 2009


On Sep 11, 2009, at 10:43 AM, Otto wrote:

> Well, like I said, my problem with that is that you shouldn't do the
> other one either.

Okay then, here's an example that probably comes up a lot in plugins.

I want to make a CSS file that gets some of its stuff from PHP.  So  
"mystyles.css.php".  Most of it is a simple echo, but a few things in  
the stylesheet are pulled from settings on the wp_settings table in  
the database.

The CSS/PHP file is pulled directly by the browser and is thus not "WP  
Aware".  How would I get that file to access the WP database?

Stephen

P.S. -- Also, if we're going to encourage coders to do it the right  
way, examples such as this would be a good idea to put into the  
Codex. :-)


More information about the wp-hackers mailing list