Yes, there’s the wpdb
class. Some examples can be found for e.g. here.
Then there’s the global $wpdb
object that contains results and other parts, set based on the current routing.
You can also utilize the WP_Query
class which is more common. There’s a default global $wp_query
object and the $wp_the_query
(?) intermediary object, that holds the default routing based result. You can use WP_Query
basically like any old school query builder and call it a poor mans ORM.