Unused var fixes. Props DD32. see #8220
git-svn-id: http://svn.automattic.com/wordpress/trunk@9716 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
322baa914d
commit
40c754df1d
|
@ -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');
|
||||
|
|
|
@ -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&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&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>
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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';
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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&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));
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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 ) ) {
|
||||
|
|
|
@ -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']);
|
||||
|
|
|
@ -29,7 +29,7 @@ function get_bookmark($bookmark, $output = OBJECT, $filter = 'raw') {
|
|||
wp_cache_add($bookmark->link_id, $bookmark, 'bookmark');
|
||||
$_bookmark = $bookmark;
|
||||
} else {
|
||||
if ( isset($GLOBALS['link']) && ($GLOBALS['link']->link_id == $link) ) {
|
||||
if ( isset($GLOBALS['link']) && ($GLOBALS['link']->link_id == $bookmark) ) {
|
||||
$_bookmark = & $GLOBALS['link'];
|
||||
} elseif ( ! $_bookmark = wp_cache_get($bookmark, 'bookmark') ) {
|
||||
$_bookmark = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->links WHERE link_id = %d LIMIT 1", $bookmark));
|
||||
|
|
|
@ -158,7 +158,6 @@ function wp_next_scheduled( $hook, $args = array() ) {
|
|||
* @return null Cron could not be spawned, because it is not needed to run.
|
||||
*/
|
||||
function spawn_cron( $local_time ) {
|
||||
global $current_blog;
|
||||
|
||||
/*
|
||||
* do not even start the cron if local server timer has drifted
|
||||
|
|
|
@ -411,7 +411,7 @@ class WP_Http {
|
|||
$length = hexdec( $match[1] );
|
||||
$chunkLength = strlen( $match[0] );
|
||||
|
||||
$strBody = substr($body, strlen( $match[0] ), $length);
|
||||
$strBody = substr($body, $chunkLength, $length);
|
||||
$parsedBody .= $strBody;
|
||||
|
||||
$body = ltrim(str_replace(array($match[0], $strBody), '', $body), "\n");
|
||||
|
|
|
@ -1512,9 +1512,7 @@ function get_avatar( $id_or_email, $size = '96', $default = '', $alt = false ) {
|
|||
$default = $avatar_default;
|
||||
}
|
||||
|
||||
if ( 'custom' == $default )
|
||||
$default = add_query_arg( 's', $size, $defaults[$avatar_default][1] );
|
||||
elseif ( 'mystery' == $default )
|
||||
if ( 'mystery' == $default )
|
||||
$default = "http://www.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s={$size}"; // ad516503a11cd5ca435acc9bb6523536 == md5('unknown@gravatar.com')
|
||||
elseif ( 'blank' == $default )
|
||||
$default = includes_url('images/blank.gif');
|
||||
|
@ -1524,6 +1522,8 @@ function get_avatar( $id_or_email, $size = '96', $default = '', $alt = false ) {
|
|||
$default = "http://www.gravatar.com/avatar/s={$size}";
|
||||
elseif ( empty($email) )
|
||||
$default = "http://www.gravatar.com/avatar/?d=$default&s={$size}";
|
||||
else
|
||||
$default = add_query_arg( 's', $size, $default );
|
||||
|
||||
if ( !empty($email) ) {
|
||||
$out = 'http://www.gravatar.com/avatar/';
|
||||
|
|
|
@ -123,7 +123,7 @@ function has_filter($tag, $function_to_check = false) {
|
|||
* @subpackage Plugin
|
||||
* @since 0.71
|
||||
* @global array $wp_filter Stores all of the filters
|
||||
* @global array $merge_filters Merges the filter hooks using this function.
|
||||
* @global array $merged_filters Merges the filter hooks using this function.
|
||||
* @global array $wp_current_filter stores the list of current filters with the current one last
|
||||
*
|
||||
* @param string $tag The name of the filter hook.
|
||||
|
@ -219,7 +219,7 @@ function remove_filter($tag, $function_to_remove, $priority = 10, $accepted_args
|
|||
* @return bool True when finished.
|
||||
*/
|
||||
function remove_all_filters($tag, $priority = false) {
|
||||
global $wp_filter, $merge_filters;
|
||||
global $wp_filter, $merged_filters;
|
||||
|
||||
if( isset($wp_filter[$tag]) ) {
|
||||
if( false !== $priority && isset($$wp_filter[$tag][$priority]) )
|
||||
|
|
|
@ -2161,7 +2161,7 @@ function &get_pages($args = '') {
|
|||
$pages = $wpdb->get_results($query);
|
||||
|
||||
if ( empty($pages) ) {
|
||||
$page = apply_filters('get_pages', array(), $r);
|
||||
$pages = apply_filters('get_pages', array(), $r);
|
||||
return $pages;
|
||||
}
|
||||
|
||||
|
@ -3322,7 +3322,7 @@ function wp_save_post_revision( $post_id ) {
|
|||
* @return object|bool The autosaved data or false on failure or when no autosave exists.
|
||||
*/
|
||||
function wp_get_post_autosave( $post_id ) {
|
||||
global $wpdb;
|
||||
|
||||
if ( !$post = get_post( $post_id ) )
|
||||
return false;
|
||||
|
||||
|
|
|
@ -186,7 +186,7 @@ function get_theme_data( $theme_file ) {
|
|||
if ( preg_match( '|Author URI:(.*)$|mi', $theme_data, $author_uri ) )
|
||||
$author_uri = clean_url( trim( $author_uri[1]) );
|
||||
else
|
||||
$author_uti = '';
|
||||
$author_uri = '';
|
||||
|
||||
if ( preg_match( '|Template:(.*)$|mi', $theme_data, $template ) )
|
||||
$template = wp_kses( trim( $template[1] ), $themes_allowed_tags );
|
||||
|
|
|
@ -259,7 +259,7 @@ function delete_usermeta( $user_id, $meta_key, $meta_value = '' ) {
|
|||
$meta_value = trim( $meta_value );
|
||||
|
||||
if ( ! empty($meta_value) )
|
||||
$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) );
|
||||
$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) );
|
||||
else
|
||||
$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) );
|
||||
|
||||
|
|
Loading…
Reference in New Issue