Should I use custom post types or a custom database tables for plugin development?

You should be skeptical of anyone who says that there is a single “right” way. The right way depends on the situation. Using the CPT infrastructure has a number of notable benefits: You get the Dashboard UI for free You automatically take advantage of WP’s caching, including any persistent cache plugins that the installation may … Read more

Why is my database import losing text widget data?

This is where your problem is: I then edited the resulting .sql file to update all of the file paths and URL references to point to our production site. You can’t do that. WordPress stores many options as “serialized data”, which contains both the string content of things and their length. So when you modify … Read more

Using wpdb to connect to a separate database

Yes it’s possible. The wpdb object can be used to access any database and query any table. Absolutely no need to be WordPress related, which is very interesting. The benefit is the ability to use all the wpdb classes and functions like get_results, etc so that there’s no need to re-invent the wheel. Here’s how: … Read more