WordPress.org

Ready to get started?Download WordPress

Forums

Code help for new plugin (2 posts)

  1. sccr410
    Member
    Posted 6 years ago #

    I'm working on a new plugin, but keep running into an issue of not having access to the database. I have a second file which also needs access to the database - in order for this plugin to work this file needs to be standalone. What files do I need to include to get access to the query fuctions?

  2. Kafkaesqui

    Posted 6 years ago #

    By including the wp-config.php file, you can access the database using WP's built-in query functionality (i.e. $wpdb->get_results(), etc.). Just about all the internal functions, classes and so on should be made available this way.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags