[wp-hackers] Use WP User Validation for Non-WP Pages

Paul paul at codehooligans.com
Mon Aug 24 21:02:54 UTC 2009


Yes. Taken from the index.php provided from WordPress distributions.

define('WP_USE_THEMES', true); // Set this to false to not load the  
theme
require('./wp-blog-header.php');	// Adjust this to the correct  
location of the php file.








On Aug 24, 2009, at 3:58 PM, Stephen Rider wrote:

> Hi --
>
> Raj's suggestion is problematic, and if official policy, should be  
> deprecated.
>
> Since wp-config.php can be in different locations, the ABSPATH set  
> at the end may be wrong.  (Normally in WordPress ABSPATH is set  
> before wp-config.php is called, but that files has a bit of "if it  
> isn't set, set it" code at the end -- that's the problematic part if  
> the files is called directly.)
>
> So a heads up to Chris, and a call to the rest of you hackers.  Is  
> there a better way to include the WP stuff without directly  
> including the wp-config?
>
> Stephen
>
> -- 
> Stephen Rider
> http://striderweb.com/
>
>
> On Aug 24, 2009, at 3:24 PM, rajasekharan wrote:
>
>> If you include the wp-config.php file in the beginning of your php  
>> page, you can bring the entire wordpress API
>> into scope of your script. From there you can do whatever user  
>> validation you need.
>>
>> Chris Williams wrote:
>>> Let me clarify, these pages will be fully part of the site,  
>>> including
>>> headers/footers as required, they just won't have a "loop".
>>>
>>>
>>>> From: Chris Williams<chris at clwill.com>
>>>> Reply-To:<wp-hackers at lists.automattic.com>
>>>> Date: Mon, 24 Aug 2009 10:23:37 -0700
>>>> To:<wp-hackers at lists.automattic.com>
>>>> Subject: [wp-hackers] Use WP User Validation for Non-WP Pages
>>>>
>>>> I want to have some pages on my site, mostly a WP blog,  
>>>> accessible to only
>>>> WP logged in users.  These are not WP pages, but other PHP-coded  
>>>> pages.
>>>>
>>>> Pointers to references on how to accomplish this are appreciated.
>
>
>
>
>
>
>
> _______________________________________________
> 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