Make WordPress Core

Changeset 6364 for trunk/wp-app.php


Ignore:
Timestamp:
12/06/2007 07:49:33 PM (17 years ago)
Author:
ryan
Message:

Remove unused vars. Props DD32. see #5418

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-app.php

    r6339 r6364  
    216216     */
    217217    function create_post() {
    218         global $blog_id, $wpdb;
     218        global $blog_id, $user_ID;
    219219        $this->get_accepted_content_type($this->atom_content_types);
    220220
     
    250250        $blog_ID = (int ) $blog_id;
    251251        $post_status = ($publish) ? 'publish' : 'draft';
    252         $post_author = (int) $user->ID;
     252        $post_author = (int) $user_ID;
    253253        $post_title = $entry->title[1];
    254254        $post_content = $entry->content[1];
     
    270270            $this->internal_error($postID->get_error_message());
    271271
    272         if (!$postID) {
     272        if (!$postID)
    273273            $this->internal_error(__('Sorry, your entry could not be posted. Something wrong happened.'));
    274         }
    275274
    276275        // getting warning here about unable to set headers
     
    297296
    298297    function put_post($postID) {
    299         global $wpdb;
    300 
    301298        // checked for valid content-types (atom+xml)
    302299        // quick check and exit
     
    314311        // check for not found
    315312        global $entry;
    316         $entry = $GLOBALS['entry'];
    317313        $this->set_current_entry($postID);
    318314
     
    377373
    378374    function get_attachment($postID = NULL) {
    379 
    380         global $entry;
    381375        if (!isset($postID)) {
    382376            $this->get_attachments();
     
    390384
    391385    function create_attachment() {
    392         global $wp, $wpdb, $wp_query, $blog_id;
    393386
    394387        $type = $this->get_accepted_content_type();
     
    419412        $url = $file['url'];
    420413        $file = $file['file'];
    421         $filename = basename($file);
    422 
    423         $header = apply_filters('wp_create_file_in_uploads', $file); // replicate
     414
     415        apply_filters('wp_create_file_in_uploads', $file); // replicate
    424416
    425417        // Construct the attachment array
     
    434426
    435427        // Save the data
    436         $postID = wp_insert_attachment($attachment, $file, $post);
    437 
    438         if (!$postID) {
     428        $postID = wp_insert_attachment($attachment, $file);
     429
     430        if (!$postID)
    439431            $this->internal_error(__('Sorry, your entry could not be posted. Something wrong happened.'));
    440         }
    441432
    442433        $output = $this->get_entry($postID, 'attachment');
     
    447438
    448439    function put_attachment($postID) {
    449         global $wpdb;
    450 
    451440        // checked for valid content-types (atom+xml)
    452441        // quick check and exit
     
    467456            $this->auth_required(__('Sorry, you do not have the right to edit this post.'));
    468457
    469         $publish = (isset($parsed->draft) && trim($parsed->draft) == 'yes') ? false : true;
    470 
    471458        extract($entry);
    472459
     
    546533
    547534    function put_file($postID) {
    548 
    549         $type = $this->get_accepted_content_type();
    550535
    551536        // first check if user can upload
     
    606591
    607592    function the_entries_url($page = NULL) {
    608         $url = $this->get_entries_url($page);
    609         echo $url;
    610     }
    611 
    612     function get_categories_url($page = NULL) {
     593        echo $this->get_entries_url($page);
     594    }
     595
     596    function get_categories_url($deprecated = '') {
    613597        return $this->app_base . $this->CATEGORIES_PATH;
    614598    }
    615599
    616600    function the_categories_url() {
    617         $url = $this->get_categories_url();
    618         echo $url;
     601        echo $this->get_categories_url();
    619602    }
    620603
     
    628611
    629612    function the_attachments_url($page = NULL) {
    630         $url = $this->get_attachments_url($page);
    631         echo $url;
     613        echo $this->get_attachments_url($page);
    632614    }
    633615
     
    639621        if(!isset($postID)) {
    640622            global $post;
    641             $postID = (int) $GLOBALS['post']->ID;
     623            $postID = (int) $post->ID;
    642624        }
    643625
     
    649631
    650632    function the_entry_url($postID = NULL) {
    651         $url = $this->get_entry_url($postID);
    652         echo $url;
     633        echo $this->get_entry_url($postID);
    653634    }
    654635
     
    656637        if(!isset($postID)) {
    657638            global $post;
    658             $postID = (int) $GLOBALS['post']->ID;
     639            $postID = (int) $post->ID;
    659640        }
    660641
     
    666647
    667648    function the_media_url($postID = NULL) {
    668         $url = $this->get_media_url($postID);
    669         echo $url;
     649        echo $this->get_media_url($postID);
    670650    }
    671651
     
    760740        log_app('function',"get_entry($postID, '$post_type')");
    761741        ob_start();
    762         global $posts, $post, $wp_query, $wp, $wpdb, $blog_id;
    763742        switch($post_type) {
    764743            case 'post':
Note: See TracChangeset for help on using the changeset viewer.