Changeset 38517 for ad-minister

Show
Ignore:
Timestamp:
04/05/08 22:46:42 (3 months ago)
Author:
henrikmelin
Message:

Removed duplicate code

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • ad-minister/trunk/ad-minister-functions.php

    r38509 r38517  
    77*/ 
    88function administer_main() { 
    9       global $wpdb; 
    10  
    11       // Auto install 
    12       if (!get_option('administer_post_id') || !administer_ok_to_go()) { 
    13             $_POST = array(); 
    14              
    15             // Does it exist already? 
    16             $sql = "select count(*) from $wpdb->posts where post_type='administer'"; 
    17             $nbr = $wpdb->get_var($sql) + 1; 
    18  
    19             // Create a new one            
    20             $_POST['post_title'] = 'Ad-minister Data Holder ' . $nbr; 
    21             $_POST['post_type'] = 'administer'; 
    22             $_POST['content'] = 'This post holds your Ad-minister data'; 
    23             $id = wp_write_post(); 
    24             update_option('administer_post_id', $id); 
    25       } 
    269 
    2710      // Check that our statistics is set up