Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm starting a new service for a customer consisting in adding a input API in their WP website. I started by creating a blank page on the root but then I realized I couldn't access all methods and function to insert datas in WP. Basically I need to insert strings and integers as custom post types and meta datas.

What would be the best way to make default functions and methods accessible in my script?

Thanks!

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Put this code in the top of your api page, it will call in the functions, but you need to tell wordpress NOT to try and draw a page as well

define('WP_USE_THEMES', false); // Tell wordpress not to draw out a page
require('/path/to/public_html/wp-load.php'); // load wordpress functions
share|improve this answer
    
That's exactly what I was expecting! Thanks –  Kaaviar Jan 6 '12 at 12:24
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.