[wp-hackers] "deprecating" direct calls to wp-config.php
trelvao at workmedia.pt
Tue Nov 17 16:54:25 UTC 2009
You already have a js var defined for that: ajaxurl
You just have to use it as yout url.
> On Tue, Nov 17, 2009 at 10:44 AM, Olivier <autremonde75 at gmail.com> wrote:
>> remove the call the wp-config.php, then when the JS code is generated
>> and added into the html file sent to the client, this php part won't
>> be resolved : <?php echo admin_url("admin-ajax.php"); ?> potentially
>> because admin_url is a function known through the core...
>> That's it, no issue with the server side ajax handling, I don't have
>> anything to change on that front as I am already using the admin-ajax
>> hooking style. The issue is really with the client side and providing
>> the right URL to call which I can't if I don't have a way to get the
>> admin_url resolved.
> Okay, but that makes no particular sense to me. If you're in a plugin
> context, then you don't have to include wp-config. You're already
> running inside WordPress.
> Why are you having to include the wp-config.php there? Are you
> generating this through a separate PHP file or something?
> it get included onto the page in question?
> Sent from Memphis, TN, United States
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
More information about the wp-hackers