Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




require_wp_db [ WordPress Function ]

require_wp_db ( No parameters )
Defined at:



Load the correct database class file.

This function is used to load the database class file either at runtime or by wp-admin/setup-config.php. We must globalize $wpdb to ensure that it is defined globally by the inline code in wp-db.php.

Source


<?php
function require_wp_db() {
    global 
$wpdb;

    require_once( 
ABSPATH WPINC '/wp-db.php' );
    if ( 
file_existsWP_CONTENT_DIR '/db.php' ) )
        require_once( 
WP_CONTENT_DIR '/db.php' );

    if ( isset( 
$wpdb ) )
        return;

    
$wpdb = new wpdbDB_USERDB_PASSWORDDB_NAMEDB_HOST );
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics