Switch language

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




wp_set_wpdb_vars [ WordPress Function ]

wp_set_wpdb_vars ( No parameters )
Access:
  • private
See:
  • wpdb::$field_types
  • wpdb::prepare()
  • wpdb::insert()
  • wpdb::update()
  • wpdb::set_prefix()
Defined at:



Sets the database table prefix and the format specifiers for database table columns.

Columns not listed here default to %s.

Source


<?php
function wp_set_wpdb_vars() {
    global 
$wpdb$table_prefix;
    if ( !empty( 
$wpdb->error ) )
        
dead_db();

    
$wpdb->field_types = array( 'post_author' => '%d''post_parent' => '%d''menu_order' => '%d''term_id' => '%d''term_group' => '%d''term_taxonomy_id' => '%d',
        
'parent' => '%d''count' => '%d','object_id' => '%d''term_order' => '%d''ID' => '%d''commment_ID' => '%d''comment_post_ID' => '%d''comment_parent' => '%d',
        
'user_id' => '%d''link_id' => '%d''link_owner' => '%d''link_rating' => '%d''option_id' => '%d''blog_id' => '%d''meta_id' => '%d''post_id' => '%d',
        
'user_status' => '%d''umeta_id' => '%d''comment_karma' => '%d''comment_count' => '%d',
        
// multisite:
        
'active' => '%d''cat_id' => '%d''deleted' => '%d''lang_id' => '%d''mature' => '%d''public' => '%d''site_id' => '%d''spam' => '%d',
    );

    
$prefix $wpdb->set_prefix$table_prefix );

    if ( 
is_wp_error$prefix ) ) {
        
wp_load_translations_early();
        
wp_die__'<strong>ERROR</strong>: <code>$table_prefix</code> in <code>wp-config.php</code> can only contain numbers, letters, and underscores.' ) );
    }
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



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