Forums

[resolved] Access wordpress function from external script (3 posts)

  1. mike235
    Member
    Posted 2 years ago #

    Hi,

    I have a php script that I call when a form is submitted (from a plugin I'm developing), obviously this script does not have access to the wordpress functions.

    How can I access the wordpress functions? Specifically, I want to access the get_option function

    Any idea would be great

  2. Samuel B
    moderator
    Posted 2 years ago #

  3. mike235
    Member
    Posted 2 years ago #

    I just found what I needed here :
    http://wpengineer.com/embed-wordpress-functions-outside-wordpress/

    It's very easy in fact, just add : require( '../../../wp-load.php' );
    at the top of your script (with relative path pointing to WP root on your server of course)

Topic Closed

This topic has been closed to new replies.

About this Topic