Switch language

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




insert_blog [ WordPress Function ]

insert_blog ( $domain, $path, $site_id )
Parameters:
  • (string) $domain The domain of the new site.
  • (string) $path The path of the new site.
  • (int) $site_id Unless you're running a multi-network install, be sure to set this value to 1.
Returns:
  • (int) The ID of the new row
Defined at:



Store basic site info in the blogs table.

This function creates a row in the wp_blogs table and returns the new blog's ID. It is the first step in creating a new blog.

Source


<?php
function insert_blog($domain$path$site_id) {
    global 
$wpdb;

    
$path trailingslashit($path);
    
$site_id = (int) $site_id;

    
$result $wpdb->insert$wpdb->blogs, array('site_id' => $site_id'domain' => $domain'path' => $path'registered' => current_time('mysql')) );
    if ( ! 
$result )
        return 
false;

    
refresh_blog_details($wpdb->insert_id);
    return 
$wpdb->insert_id;
}
?>

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