Ticket #8220: unused.diff

File unused.diff, 15.0 KB (added by DD32, 4 years ago)
  • wp-admin/edit-form-advanced.php

     
    166166} elseif ( is_sticky( $post->ID ) ) { 
    167167        $visibility = 'public'; 
    168168        $visibility_trans = __('Public, Sticky'); 
    169         $sticky = 'sticky'; 
    170169} else { 
    171170        $visibility = 'public'; 
    172171        $visibility_trans = __('Public'); 
  • wp-admin/edit-link-form.php

     
    8787<div id="delete-action"> 
    8888<?php 
    8989if ( !empty($_GET['action']) && 'edit' == $_GET['action'] && current_user_can('manage_links') ) { ?> 
    90         <a class="submitdelete deletion" href="<?php echo wp_nonce_url("link.php?action=delete&amp;link_id=$link->link_id", 'delete-bookmark_' . $link->link_id); ?>" onclick="if ( confirm('<?php echo js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n  'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this link '%s'\n  'Cancel' to stop, 'OK' to delete."), $link->link_name )); ?>') ) {return true;}return false;"><?php _e('Delete'); ?></a> 
     90        <a class="submitdelete deletion" href="<?php echo wp_nonce_url("link.php?action=delete&amp;link_id=$link->link_id", 'delete-bookmark_' . $link->link_id); ?>" onclick="if ( confirm('<?php echo js_escape(sprintf(__("You are about to delete this link '%s'\n  'Cancel' to stop, 'OK' to delete."), $link->link_name )); ?>') ) {return true;}return false;"><?php _e('Delete'); ?></a> 
    9191<?php } ?> 
    9292</div> 
    9393 
  • wp-admin/import/blogger.php

     
    522522        } 
    523523 
    524524        function import_post( $entry ) { 
    525                 global $wpdb, $importing_blog; 
     525                global $importing_blog; 
    526526 
    527527                // The old permalink is all Blogger gives us to link comments to their posts. 
    528528                if ( isset( $entry->draft ) ) 
     
    659659        } 
    660660 
    661661        function get_user_options($current) { 
    662                 global $wpdb, $importer_users; 
     662                global $importer_users; 
    663663                if ( ! isset( $importer_users ) ) 
    664664                        $importer_users = (array) get_users_of_blog(); 
    665665 
  • wp-admin/import/mt.php

     
    5555        } 
    5656 
    5757        function users_form($n) { 
    58                 global $wpdb, $testing; 
     58                global $wpdb; 
    5959                $users = $wpdb->get_results("SELECT * FROM $wpdb->users ORDER BY ID"); 
    6060?><select name="userselect[<?php echo $n; ?>]"> 
    6161        <option value="#NONE#"><?php _e('- Select -') ?></option> 
     
    101101 
    102102        //function to check the authorname and do the mapping 
    103103        function checkauthor($author) { 
    104                 global $wpdb; 
    105104                //mtnames is an array with the names in the mt import file 
    106105                $pass = wp_generate_password(); 
    107106                if (!(in_array($author, $this->mtnames))) { //a new mt author name is found 
     
    109108                        $this->mtnames[$this->j] = $author; //add that new mt author name to an array 
    110109                        $user_id = username_exists($this->newauthornames[$this->j]); //check if the new author name defined by the user is a pre-existing wp user 
    111110                        if (!$user_id) { //banging my head against the desk now. 
    112                                 if ($newauthornames[$this->j] == 'left_blank') { //check if the user does not want to change the authorname 
     111                                if ($this->newauthornames[$this->j] == 'left_blank') { //check if the user does not want to change the authorname 
    113112                                        $user_id = wp_create_user($author, $pass); 
    114113                                        $this->newauthornames[$this->j] = $author; //now we have a name, in the place of left_blank. 
    115114                                } else { 
  • wp-admin/includes/dashboard.php

     
    353353} 
    354354 
    355355function wp_dashboard_recent_drafts( $drafts = false ) { 
    356         global $post; 
    357356        if ( !$drafts ) { 
    358357                $drafts_query = new WP_Query( array( 
    359358                        'post_type' => 'post', 
  • wp-admin/includes/file.php

     
    330330        // You may define your own function and pass the name in $overrides['upload_error_handler'] 
    331331        $upload_error_handler = 'wp_handle_upload_error'; 
    332332 
     333        // You may define your own function and pass the name in $overrides['unique_filename_callback'] 
     334        $unique_filename_callback = null; 
     335 
    333336        // $_POST['action'] must be set and its value must equal $overrides['action'] or this: 
    334337        $action = 'wp_handle_sideload'; 
    335338 
  • wp-admin/includes/media.php

     
    262262        ), $post_data ); 
    263263 
    264264        // Save the data 
    265         $id = wp_insert_attachment($attachment, $file, $post_parent); 
     265        $id = wp_insert_attachment($attachment, $file, $post_id); 
    266266        if ( !is_wp_error($id) ) { 
    267267                wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) ); 
    268268                return $url; 
     
    905905                $post = (object) $post; 
    906906 
    907907        $edit_post = sanitize_post($post, 'edit'); 
    908         $file = wp_get_attachment_url($post->ID); 
    909         $link = get_attachment_link($post->ID); 
    910908 
    911909        $form_fields = array( 
    912910                'post_title'   => array( 
     
    10191017        else 
    10201018                return false; 
    10211019 
    1022         $title_label = __('Title'); 
    1023         $description_label = __('Description'); 
    1024         $tags_label = __('Tags'); 
    1025  
    10261020        $toggle_on = __('Show'); 
    10271021        $toggle_off = __('Hide'); 
    10281022 
     
    10301024 
    10311025        $filename = basename($post->guid); 
    10321026        $title = attribute_escape($post->post_title); 
    1033         $description = attribute_escape($post->post_content); 
     1027 
    10341028        if ( $_tags = get_the_tags($attachment_id) ) { 
    10351029                foreach ( $_tags as $tag ) 
    10361030                        $tags[] = $tag->name; 
  • wp-admin/includes/plugin-install.php

     
    2727 * @return mixed 
    2828 */ 
    2929function plugins_api($action, $args = null) { 
    30         global $wp_version; 
    3130 
    3231        if( is_array($args) ) 
    3332                $args = (object)$args; 
     
    247246 * @param int $totalpages Number of pages. 
    248247 */ 
    249248function display_plugins_table($plugins, $page = 1, $totalpages = 1){ 
    250         global $tab; 
    251  
    252249        $type = isset($_REQUEST['type']) ? stripslashes( $_REQUEST['type'] ) : ''; 
    253250        $term = isset($_REQUEST['s']) ? stripslashes( $_REQUEST['s'] ) : ''; 
    254251 
     
    674671                $install_actions = apply_filters('install_plugin_complete_actions', array( 
    675672                                                        'activate_plugin' => '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin') . '" target="_parent">' . __('Activate Plugin') . '</a>', 
    676673                                                        'plugins_page' => '<a href="' . admin_url('plugins.php') . '" title="' . __('Goto plugins page') . '" target="_parent">' . __('Return to Plugins page') . '</a>' 
    677                                                         ), $plugin_information, $plugin_file); 
     674                                                        ), array(), $plugin_file); 
    678675                if ( ! empty($install_actions) ) 
    679676                        show_message('<strong>' . __('Actions:') . '</strong> ' . implode(' | ', (array)$install_actions)); 
    680677        } 
  • wp-admin/includes/post.php

     
    769769 * @return unknown 
    770770 */ 
    771771function wp_edit_posts_query( $q = false ) { 
    772         global $wpdb; 
    773772        if ( false === $q ) 
    774773                $q = $_GET; 
    775774        $q['m']   = isset($q['m']) ? (int) $q['m'] : 0; 
     
    832831 * @return unknown 
    833832 */ 
    834833function wp_edit_attachments_query( $q = false ) { 
    835         global $wpdb; 
    836834        if ( false === $q ) 
    837835                $q = $_GET; 
    838836 
  • wp-admin/includes/template.php

     
    207207        $columns = $is_tag ? get_column_headers('tag') : get_column_headers('category'); 
    208208        $hidden = array_intersect( array_keys( $columns ), array_filter( (array) get_user_option( "manage-$type-columns-hidden" ) ) ); 
    209209        $col_count = count($columns) - count($hidden); 
    210         $output = ''; ?> 
     210        ?> 
    211211 
    212212<form method="get" action=""><table style="display: none"><tbody id="inlineedit"> 
    213213        <tr id="inline-edit" class="inline-edit-row" style="display: none"><td colspan="<?php echo $col_count; ?>"> 
     
    659659 
    660660        // convert it to table rows 
    661661        $out = ''; 
    662         $class = ''; 
    663662        $count = 0; 
    664663        foreach( $tags as $tag ) 
    665664                $out .= _tag_row( $tag, ++$count % 2 ? ' class="iedit alternate"' : ' class="iedit"' ); 
     
    18781877        global $comment, $post; 
    18791878        $comment = get_comment( $comment_id ); 
    18801879        $post = get_post($comment->comment_post_ID); 
    1881         $authordata = get_userdata($post->post_author); 
    18821880        $the_comment_status = wp_get_comment_status($comment->comment_ID); 
    18831881 
    18841882        if ( current_user_can( 'edit_post', $post->ID ) ) { 
  • wp-admin/page.php

     
    2222 * @param int $page_ID Page ID. 
    2323 */ 
    2424function redirect_page($page_ID) { 
     25        global $action; 
     26 
    2527        $referredby = ''; 
    2628        if ( !empty($_POST['referredby']) ) { 
    2729                $referredby = preg_replace('|https?://[^/]+|i', '', $_POST['referredby']); 
  • wp-includes/bookmark.php

     
    2929                wp_cache_add($bookmark->link_id, $bookmark, 'bookmark'); 
    3030                $_bookmark = $bookmark; 
    3131        } else { 
    32                 if ( isset($GLOBALS['link']) && ($GLOBALS['link']->link_id == $link) ) { 
     32                if ( isset($GLOBALS['link']) && ($GLOBALS['link']->link_id == $bookmark) ) { 
    3333                        $_bookmark = & $GLOBALS['link']; 
    3434                } elseif ( ! $_bookmark = wp_cache_get($bookmark, 'bookmark') ) { 
    3535                        $_bookmark = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->links WHERE link_id = %d LIMIT 1", $bookmark)); 
  • wp-includes/cron.php

     
    158158 * @return null Cron could not be spawned, because it is not needed to run. 
    159159 */ 
    160160function spawn_cron( $local_time ) { 
    161         global $current_blog; 
    162161 
    163162        /* 
    164163         * do not even start the cron if local server timer has drifted 
  • wp-includes/http.php

     
    411411                                $length = hexdec( $match[1] ); 
    412412                                $chunkLength = strlen( $match[0] ); 
    413413 
    414                                 $strBody = substr($body, strlen( $match[0] ), $length); 
     414                                $strBody = substr($body, $chunkLength, $length); 
    415415                                $parsedBody .= $strBody; 
    416416 
    417417                                $body = ltrim(str_replace(array($match[0], $strBody), '', $body), "\n"); 
  • wp-includes/pluggable.php

     
    15121512                        $default = $avatar_default; 
    15131513        } 
    15141514 
    1515         if ( 'custom' == $default ) 
    1516                 $default = add_query_arg( 's', $size, $defaults[$avatar_default][1] ); 
    1517         elseif ( 'mystery' == $default ) 
     1515        if ( 'mystery' == $default ) 
    15181516                $default = "http://www.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s={$size}"; // ad516503a11cd5ca435acc9bb6523536 == md5('unknown@gravatar.com') 
    15191517        elseif ( 'blank' == $default ) 
    15201518                $default = includes_url('images/blank.gif'); 
     
    15241522                $default = "http://www.gravatar.com/avatar/s={$size}"; 
    15251523        elseif ( empty($email) ) 
    15261524                $default = "http://www.gravatar.com/avatar/?d=$default&amp;s={$size}"; 
     1525        else 
     1526                $default = add_query_arg( 's', $size, $default ); 
    15271527 
    15281528        if ( !empty($email) ) { 
    15291529                $out = 'http://www.gravatar.com/avatar/'; 
  • wp-includes/plugin.php

     
    123123 * @subpackage Plugin 
    124124 * @since 0.71 
    125125 * @global array $wp_filter Stores all of the filters 
    126  * @global array $merge_filters Merges the filter hooks using this function. 
     126 * @global array $merged_filters Merges the filter hooks using this function. 
    127127 * @global array $wp_current_filter stores the list of current filters with the current one last 
    128128 * 
    129129 * @param string $tag The name of the filter hook. 
     
    219219 * @return bool True when finished. 
    220220 */ 
    221221function remove_all_filters($tag, $priority = false) { 
    222         global $wp_filter, $merge_filters; 
     222        global $wp_filter, $merged_filters; 
    223223 
    224224        if( isset($wp_filter[$tag]) ) { 
    225225                if( false !== $priority && isset($$wp_filter[$tag][$priority]) ) 
  • wp-includes/post.php

     
    21602160        $pages = $wpdb->get_results($query); 
    21612161 
    21622162        if ( empty($pages) ) { 
    2163                 $page = apply_filters('get_pages', array(), $r); 
     2163                $pages = apply_filters('get_pages', array(), $r); 
    21642164                return $pages; 
    21652165        } 
    21662166 
     
    33213321 * @return object|bool The autosaved data or false on failure or when no autosave exists. 
    33223322 */ 
    33233323function wp_get_post_autosave( $post_id ) { 
    3324         global $wpdb; 
     3324 
    33253325        if ( !$post = get_post( $post_id ) ) 
    33263326                return false; 
    33273327 
  • wp-includes/theme.php

     
    186186        if ( preg_match( '|Author URI:(.*)$|mi', $theme_data, $author_uri ) ) 
    187187                $author_uri = clean_url( trim( $author_uri[1]) ); 
    188188        else 
    189                 $author_uti = ''; 
     189                $author_uri = ''; 
    190190 
    191191        if ( preg_match( '|Template:(.*)$|mi', $theme_data, $template ) ) 
    192192                $template = wp_kses( trim( $template[1] ), $themes_allowed_tags ); 
  • wp-includes/user.php

     
    259259        $meta_value = trim( $meta_value ); 
    260260 
    261261        if ( ! empty($meta_value) ) 
    262                 $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s AND meta_value = %s", $userid, $meta_key, $meta_value) ); 
     262                $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s AND meta_value = %s", $user_id, $meta_key, $meta_value) ); 
    263263        else 
    264264                $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) ); 
    265265