Is there a function or command that pulls the db connection info from the WP blog? I am writing a Plugin which would have to connect to the db to retrieve the info, wondering if there was one single command/function i could call which could connect. this would make the plugin portable and would work on any WP blog. is this possible?
Leave a Reply
You must be logged in to post a comment.
See the Interfacing with the Database docs.
You should just be able to use the global (curse you, WordPress) variable
$wpdb
in your plugin functions, ie:Plugins also have a few methods for storing “options” in the database. I just found this article, it details things fairly well.
If you want to create your own query with database then you can try this
You will get table prefix on $table_prefix this variable.
I think it will help you. For preview you can check my github repo https://github.com/webdeveloperkanai/flutter-wordpress-blog-view-app-full-setup
Thanks