I need to make Wordpress use another database (not the one specified in wp-config site-wide) on the "Comments" admin backend. I then must be able to edit, approve, delete etc. comments as usual. The database server I am going to connect to has been setup to accept external connections.
I have a couple of ideas how to approach this:
- from wp-config.php: have an if block to change the database connection strings if user is viewing comments page.
However this doesn't sound good to me, I assume this may create a lot of unnecessary database connections if user goes back and forth to the comments page.
- modify wp-admin files: create an instance of wpdb and tell Wordpress to use it for comment administration.
However, I can't find the .php files that get the comments from the database (so I can change the database where they do it). Have been looking at edit-comments.php->class-wp-comments-list-table.php->class-wp-list-table.php (down to base class), but I can't see the bit that talks to the database.
- Any hooks available to tap into and change the database? (doubt it)
Many thanks in advance.