Unused var fixes. Props DD32. see #8220

git-svn-id: https://develop.svn.wordpress.org/trunk@9716 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2008-11-15 18:10:35 +00:00
parent 95fdf388a9
commit fab4e5a68e
19 changed files with 25 additions and 37 deletions

View File

@@ -160,7 +160,6 @@ if ( !empty( $post->post_password ) ) {
} elseif ( is_sticky( $post->ID ) ) {
$visibility = 'public';
$visibility_trans = __('Public, Sticky');
$sticky = 'sticky';
} else {
$visibility = 'public';
$visibility_trans = __('Public');

View File

@@ -87,7 +87,7 @@ function link_submit_meta_box($link) {
<div id="delete-action">
<?php
if ( !empty($_GET['action']) && 'edit' == $_GET['action'] && current_user_can('manage_links') ) { ?>
<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>
<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>
<?php } ?>
</div>

View File

@@ -522,7 +522,7 @@ class Blogger_Import {
}
function import_post( $entry ) {
global $wpdb, $importing_blog;
global $importing_blog;
// The old permalink is all Blogger gives us to link comments to their posts.
if ( isset( $entry->draft ) )
@@ -659,7 +659,7 @@ class Blogger_Import {
}
function get_user_options($current) {
global $wpdb, $importer_users;
global $importer_users;
if ( ! isset( $importer_users ) )
$importer_users = (array) get_users_of_blog();

View File

@@ -55,7 +55,7 @@ class MT_Import {
}
function users_form($n) {
global $wpdb, $testing;
global $wpdb;
$users = $wpdb->get_results("SELECT * FROM $wpdb->users ORDER BY ID");
?><select name="userselect[<?php echo $n; ?>]">
<option value="#NONE#"><?php _e('- Select -') ?></option>
@@ -101,7 +101,6 @@ class MT_Import {
//function to check the authorname and do the mapping
function checkauthor($author) {
global $wpdb;
//mtnames is an array with the names in the mt import file
$pass = wp_generate_password();
if (!(in_array($author, $this->mtnames))) { //a new mt author name is found
@@ -109,7 +108,7 @@ class MT_Import {
$this->mtnames[$this->j] = $author; //add that new mt author name to an array
$user_id = username_exists($this->newauthornames[$this->j]); //check if the new author name defined by the user is a pre-existing wp user
if (!$user_id) { //banging my head against the desk now.
if ($newauthornames[$this->j] == 'left_blank') { //check if the user does not want to change the authorname
if ($this->newauthornames[$this->j] == 'left_blank') { //check if the user does not want to change the authorname
$user_id = wp_create_user($author, $pass);
$this->newauthornames[$this->j] = $author; //now we have a name, in the place of left_blank.
} else {

View File

@@ -353,7 +353,6 @@ function wp_dashboard_quick_press() {
}
function wp_dashboard_recent_drafts( $drafts = false ) {
global $post;
if ( !$drafts ) {
$drafts_query = new WP_Query( array(
'post_type' => 'post',

View File

@@ -330,6 +330,9 @@ function wp_handle_sideload( &$file, $overrides = false ) {
// You may define your own function and pass the name in $overrides['upload_error_handler']
$upload_error_handler = 'wp_handle_upload_error';
// You may define your own function and pass the name in $overrides['unique_filename_callback']
$unique_filename_callback = null;
// $_POST['action'] must be set and its value must equal $overrides['action'] or this:
$action = 'wp_handle_sideload';

View File

@@ -262,7 +262,7 @@ function media_handle_sideload($file_array, $post_id, $desc = null, $post_data =
), $post_data );
// Save the data
$id = wp_insert_attachment($attachment, $file, $post_parent);
$id = wp_insert_attachment($attachment, $file, $post_id);
if ( !is_wp_error($id) ) {
wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) );
return $url;
@@ -905,8 +905,6 @@ function get_attachment_fields_to_edit($post, $errors = null) {
$post = (object) $post;
$edit_post = sanitize_post($post, 'edit');
$file = wp_get_attachment_url($post->ID);
$link = get_attachment_link($post->ID);
$form_fields = array(
'post_title' => array(
@@ -1019,10 +1017,6 @@ function get_media_item( $attachment_id, $args = null ) {
else
return false;
$title_label = __('Title');
$description_label = __('Description');
$tags_label = __('Tags');
$toggle_on = __('Show');
$toggle_off = __('Hide');
@@ -1030,7 +1024,7 @@ function get_media_item( $attachment_id, $args = null ) {
$filename = basename($post->guid);
$title = attribute_escape($post->post_title);
$description = attribute_escape($post->post_content);
if ( $_tags = get_the_tags($attachment_id) ) {
foreach ( $_tags as $tag )
$tags[] = $tag->name;

View File

@@ -27,7 +27,6 @@
* @return mixed
*/
function plugins_api($action, $args = null) {
global $wp_version;
if( is_array($args) )
$args = (object)$args;
@@ -247,8 +246,6 @@ function install_updated($page = 1) {
* @param int $totalpages Number of pages.
*/
function display_plugins_table($plugins, $page = 1, $totalpages = 1){
global $tab;
$type = isset($_REQUEST['type']) ? stripslashes( $_REQUEST['type'] ) : '';
$term = isset($_REQUEST['s']) ? stripslashes( $_REQUEST['s'] ) : '';
@@ -674,7 +671,7 @@ function do_plugin_install_local_package($package, $filename = '') {
$install_actions = apply_filters('install_plugin_complete_actions', array(
'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>',
'plugins_page' => '<a href="' . admin_url('plugins.php') . '" title="' . __('Goto plugins page') . '" target="_parent">' . __('Return to Plugins page') . '</a>'
), $plugin_information, $plugin_file);
), array(), $plugin_file);
if ( ! empty($install_actions) )
show_message('<strong>' . __('Actions:') . '</strong> ' . implode(' | ', (array)$install_actions));
}

View File

@@ -769,7 +769,6 @@ function get_available_post_statuses($type = 'post') {
* @return unknown
*/
function wp_edit_posts_query( $q = false ) {
global $wpdb;
if ( false === $q )
$q = $_GET;
$q['m'] = isset($q['m']) ? (int) $q['m'] : 0;
@@ -832,7 +831,6 @@ function get_available_post_mime_types($type = 'attachment') {
* @return unknown
*/
function wp_edit_attachments_query( $q = false ) {
global $wpdb;
if ( false === $q )
$q = $_GET;

View File

@@ -207,7 +207,7 @@ function inline_edit_term_row($type) {
$columns = $is_tag ? get_column_headers('tag') : get_column_headers('category');
$hidden = array_intersect( array_keys( $columns ), array_filter( (array) get_user_option( "manage-$type-columns-hidden" ) ) );
$col_count = count($columns) - count($hidden);
$output = ''; ?>
?>
<form method="get" action=""><table style="display: none"><tbody id="inlineedit">
<tr id="inline-edit" class="inline-edit-row" style="display: none"><td colspan="<?php echo $col_count; ?>">
@@ -659,7 +659,6 @@ function tag_rows( $page = 1, $pagesize = 20, $searchterms = '' ) {
// convert it to table rows
$out = '';
$class = '';
$count = 0;
foreach( $tags as $tag )
$out .= _tag_row( $tag, ++$count % 2 ? ' class="iedit alternate"' : ' class="iedit"' );
@@ -1879,7 +1878,6 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true
global $comment, $post;
$comment = get_comment( $comment_id );
$post = get_post($comment->comment_post_ID);
$authordata = get_userdata($post->post_author);
$the_comment_status = wp_get_comment_status($comment->comment_ID);
if ( current_user_can( 'edit_post', $post->ID ) ) {

View File

@@ -22,6 +22,8 @@ wp_reset_vars(array('action'));
* @param int $page_ID Page ID.
*/
function redirect_page($page_ID) {
global $action;
$referredby = '';
if ( !empty($_POST['referredby']) ) {
$referredby = preg_replace('|https?://[^/]+|i', '', $_POST['referredby']);