WordPress.org

Ready to get started?Download WordPress

Forums

get_option from externally available page (3 posts)

  1. Douglas Karr
    Member
    Posted 5 years ago #

    I'm building a plugin that has builds a form via widget in the sidebar. I would like to post the results of the form back to the plugin directory to a processing page.

    The problem is that the processing page is externally available this way. Form posts to page. Page posts to API of another site. The results are returned and the user returns to the page where the submission occurred.

    My page in the plugin's directory is called 'subscribe.php'. I want to grab some of the options for the plugin using get_option. I have an admin page that saves these to the wp_options table.

    The question: What includes or require_once pages do I need to include on my stand-alone processing page that will allow the page to get the options from the wpdb?

  2. moshu
    Member
    Posted 5 years ago #

    Usually, adding

    <?php
    require('./path-to-your-wp-install/wp-blog-header.php');
    ?>

    on the top makes it possible to call any WP function on an external file.

  3. Douglas Karr
    Member
    Posted 5 years ago #

    That's it moshu! You're a lifesaver.

Topic Closed

This topic has been closed to new replies.

About this Topic