Trim tailing whitespace

git-svn-id: http://svn.automattic.com/wordpress/trunk@11450 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2009-05-24 23:47:49 +00:00
parent d514a0d6b2
commit 2df887bd07
54 changed files with 218 additions and 218 deletions

View File

@ -1064,10 +1064,10 @@ case 'inline-save':
}
$data = &$_POST;
$post = get_post( $post_ID, ARRAY_A );
$post = add_magic_quotes($post); //since it is from db
$data['content'] = $post['post_content'];
$data['excerpt'] = $post['post_excerpt'];
@ -1323,7 +1323,7 @@ case 'save-widget' :
echo "deleted:$widget_id";
die();
}
die('1');
break;
default :

View File

@ -24,7 +24,7 @@ header( 'Expires: Wed, 11 Jan 1984 05:00:00 GMT' );
header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' );
header( 'Cache-Control: no-cache, must-revalidate, max-age=0' );
header( 'Pragma: no-cache' );
header( 'Content-Type: text/cache-manifest; charset=UTF-8' );
header( 'Content-Type: text/cache-manifest; charset=UTF-8' );
?>
CACHE MANIFEST
#

View File

@ -193,7 +193,7 @@ a.widget-action {
line-height: 16px;
}
.widget-inside,
.widget-inside,
.widget-description {
display: none;
}

View File

@ -50,7 +50,7 @@ if(!function_exists('link_exists'))
/**
* Convert from dotclear charset to utf8 if required
*
*
* @package WordPress
* @subpackage Dotclear_Import
*

View File

@ -34,7 +34,7 @@ class WP_Upgrader {
else
$this->skin = $skin;
}
function init() {
$this->skin->set_upgrader($this);
$this->generic_strings();
@ -521,7 +521,7 @@ class Theme_Upgrader extends WP_Upgrader {
}
function install($package) {
$this->init();
$this->install_strings();
@ -786,7 +786,7 @@ class WP_Upgrader_Skin {
}
/**
* Plugin Upgrader Skin for WordPress Plugin Upgrades.
* Plugin Upgrader Skin for WordPress Plugin Upgrades.
*
* @TODO More Detailed docs, for methods as well.
*
@ -835,7 +835,7 @@ class Plugin_Upgrader_Skin extends WP_Upgrader_Skin {
}
/**
* Plugin Installer Skin for WordPress Plugin Installer.
* Plugin Installer Skin for WordPress Plugin Installer.
*
* @TODO More Detailed docs, for methods as well.
*
@ -890,7 +890,7 @@ class Plugin_Installer_Skin extends WP_Upgrader_Skin {
}
/**
* Theme Installer Skin for the WordPress Theme Installer.
* Theme Installer Skin for the WordPress Theme Installer.
*
* @TODO More Detailed docs, for methods as well.
*
@ -955,7 +955,7 @@ class Theme_Installer_Skin extends WP_Upgrader_Skin {
}
/**
* Theme Upgrader Skin for WordPress Theme Upgrades.
* Theme Upgrader Skin for WordPress Theme Upgrades.
*
* @TODO More Detailed docs, for methods as well.
*

View File

@ -317,7 +317,7 @@ function wp_dashboard_right_now() {
echo "\n\t".'<div class="versions">';
$ct = current_theme_info();
echo "\n\t<p>";
if ( !empty($wp_registered_sidebars) ) {
$sidebars_widgets = wp_get_sidebars_widgets();

View File

@ -71,7 +71,7 @@ function get_home_path() {
if ( $home != '' && $home != $siteurl ) {
$wp_path_rel_to_home = str_replace($home, '', $siteurl); /* $siteurl - $home */
$pos = strpos($_SERVER["SCRIPT_FILENAME"], $wp_path_rel_to_home);
$home_path = substr($_SERVER["SCRIPT_FILENAME"], 0, $pos);
$home_path = substr($_SERVER["SCRIPT_FILENAME"], 0, $pos);
$home_path = trailingslashit( $home_path );
} else {
$home_path = ABSPATH;
@ -687,7 +687,7 @@ function request_filesystem_credentials($form_post, $type = '', $error = false)
else if ( !isset($credentials['connection_type']) || (isset($_POST['connection_type']) && 'ftp' == $_POST['connection_type']) )
$credentials['connection_type'] = 'ftp';
if ( ! $error &&
if ( ! $error &&
(
( !empty($credentials['password']) && !empty($credentials['username']) && !empty($credentials['hostname']) ) ||
( 'ssh' == $credentials['connection_type'] && !empty($credentials['public_key']) && !empty($credentials['private_key']) )

View File

@ -194,7 +194,7 @@ function media_handle_upload($file_id, $post_id, $post_data = array()) {
if ( isset($file['error']) )
return new WP_Error( 'upload_error', $file['error'] );
$name_parts = pathinfo($name);
$name = trim( substr( $name, 0, -(1 + strlen($name_parts['extension'])) ) );
@ -327,7 +327,7 @@ if ( is_string($content_func) )
$args = func_get_args();
$args = array_slice($args, 1);
call_user_func_array($content_func, $args);
do_action('admin_print_footer_scripts');
?>
<script type="text/javascript">if(typeof wpOnload=='function')wpOnload();</script>

View File

@ -138,18 +138,18 @@ function save_mod_rewrite_rules() {
/**
* Updates the IIS web.config file with the current rules if it is writable.
* If the permalinks do not require rewrite rules then the rules are deleted from the web.config file.
*
*
* @since 2.8.0
*
*
* @return bool True if web.config was updated successfully
*/
function iis7_save_url_rewrite_rules(){
global $wp_rewrite;
$home_path = get_home_path();
$web_config_file = $home_path . 'web.config';
// Using win_is_writable() instead of is_writable() because of a bug in Windows PHP
// Using win_is_writable() instead of is_writable() because of a bug in Windows PHP
if ( ( ! file_exists($web_config_file) && win_is_writable($home_path) && $wp_rewrite->using_mod_rewrite_permalinks() ) || win_is_writable($web_config_file) ) {
if ( iis7_supports_permalinks() ) {
$rule = $wp_rewrite->iis7_url_rewrite_rules();
@ -401,15 +401,15 @@ function wp_menu_unfold() {
/**
* Check if IIS 7 supports pretty permalinks
*
*
* @since 2.8.0
*
*
* @return bool
*/
function iis7_supports_permalinks() {
global $is_iis7;
$supports_permalinks = false;
$supports_permalinks = false;
if ( $is_iis7 ) {
/* First we check if the DOMDocument class exists. If it does not exist,
* which is the case for PHP 4.X, then we cannot easily update the xml configuration file,
@ -418,29 +418,29 @@ function iis7_supports_permalinks() {
* is recommended to use PHP 5.X NTS.
* Next we check if the URL Rewrite Module 1.1 is loaded and enabled for the web site. When
* URL Rewrite 1.1 is loaded it always sets a server variable called 'IIS_UrlRewriteModule'.
* Lastly we make sure that PHP is running via FastCGI. This is important because if it runs
* Lastly we make sure that PHP is running via FastCGI. This is important because if it runs
* via ISAPI then pretty permalinks will not work.
*/
$supports_permalinks = class_exists('DOMDocument') && isset($_SERVER['IIS_UrlRewriteModule']) && ( php_sapi_name() == 'cgi-fcgi' );
}
return apply_filters('iis7_supports_permalinks', $supports_permalinks);
}
/**
* Check if rewrite rule for WordPress already exists in the IIS 7 configuration file
*
*
* @since 2.8.0
*
*
* @return bool
* @param string $filename The file path to the configuration file
*/
function iis7_rewrite_rule_exists($filename) {
function iis7_rewrite_rule_exists($filename) {
if ( ! file_exists($filename) )
return false;
return false;
if ( ! class_exists('DOMDocument') )
return false;
$doc = new DOMDocument();
if ( $doc->load($filename) === false )
return false;
@ -449,25 +449,25 @@ function iis7_rewrite_rule_exists($filename) {
if ( $rules->length == 0 )
return false;
else
return true;
return true;
}
/**
* Delete WordPress rewrite rule from web.config file if it exists there
*
* @since 2.8.0
* @since 2.8.0
*
* @param string $filename Name of the configuration file
* @return bool
*/
function iis7_delete_rewrite_rule($filename) {
function iis7_delete_rewrite_rule($filename) {
// If configuration file does not exist then rules also do not exist so there is nothing to delete
if ( ! file_exists($filename) )
return true;
if ( ! class_exists('DOMDocument') )
return false;
$doc = new DOMDocument();
$doc->preserveWhiteSpace = false;
@ -487,30 +487,30 @@ function iis7_delete_rewrite_rule($filename) {
/**
* Add WordPress rewrite rule to the IIS 7 configuration file.
*
*
* @since 2.8.0
*
*
* @param string $filename The file path to the configuration file
* @param string $rewrite_rule The XML fragment with URL Rewrite rule
* @return bool
*/
function iis7_add_rewrite_rule($filename, $rewrite_rule) {
function iis7_add_rewrite_rule($filename, $rewrite_rule) {
if ( ! class_exists('DOMDocument') )
return false;
// If configuration file does not exist then we create one.
if ( ! file_exists($filename) ) {
$fp = fopen( $filename, 'w');
fwrite($fp, '<configuration/>');
fclose($fp);
}
$doc = new DOMDocument();
$doc->preserveWhiteSpace = false;
if ( $doc->load($filename) === false )
return false;
$xpath = new DOMXPath($doc);
// First check if the rule already exists as in that case there is no need to re-add it
@ -524,7 +524,7 @@ function iis7_add_rewrite_rule($filename, $rewrite_rule) {
$rules_node = $xmlnodes->item(0);
} else {
$rules_node = $doc->createElement('rules');
$xmlnodes = $xpath->query('/configuration/system.webServer/rewrite');
if ( $xmlnodes->length > 0 ) {
$rewrite_node = $xmlnodes->item(0);
@ -540,7 +540,7 @@ function iis7_add_rewrite_rule($filename, $rewrite_rule) {
} else {
$system_webServer_node = $doc->createElement('system.webServer');
$system_webServer_node->appendChild($rewrite_node);
$xmlnodes = $xpath->query('/configuration');
if ( $xmlnodes->length > 0 ) {
$config_node = $xmlnodes->item(0);
@ -553,20 +553,20 @@ function iis7_add_rewrite_rule($filename, $rewrite_rule) {
}
}
}
$rule_fragment = $doc->createDocumentFragment();
$rule_fragment->appendXML($rewrite_rule);
$rules_node->appendChild($rule_fragment);
$doc->formatOutput = true;
$doc->formatOutput = true;
saveDomDocument($doc, $filename);
return true;
return true;
}
/**
* Saves the XML document into a file
*
*
* @since 2.8.0
*
* @param DOMDocument $doc

View File

@ -468,7 +468,7 @@ function delete_plugins($plugins, $redirect = '' ) {
return new WP_Error('could_not_remove_plugin', sprintf(__('Could not fully remove the plugin(s) %s'), implode(', ', $errors)) );
// Force refresh of plugin update information
if ( $current = get_transient('update_plugins') ) {
if ( $current = get_transient('update_plugins') ) {
unset( $current->response[ $plugin_file ] );
set_transient('update_plugins', $current);
}
@ -598,7 +598,7 @@ function add_menu_page( $page_title, $menu_title, $access_level, $file, $functio
if ( empty($icon_url) )
$icon_url = 'images/generic.png';
elseif ( is_ssl() && 0 === strpos($icon_url, 'http://') )
$icon_url = 'https://' . substr($icon_url, 7);
$icon_url = 'https://' . substr($icon_url, 7);
$menu[] = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url );
@ -640,7 +640,7 @@ function add_utility_page( $page_title, $menu_title, $access_level, $file, $func
if ( empty($icon_url) )
$icon_url = 'images/generic.png';
elseif ( is_ssl() && 0 === strpos($icon_url, 'http://') )
$icon_url = 'https://' . substr($icon_url, 7);
$icon_url = 'https://' . substr($icon_url, 7);
$_wp_last_utility_menu++;

View File

@ -927,7 +927,7 @@ function get_sample_permalink($id, $title=null, $name = null) {
$post->post_name = sanitize_title($post->post_name? $post->post_name : $post->post_title, $post->ID);
}
$post->post_name = wp_unique_post_slug($post->post_name, $post->ID, $post->post_status, $post->post_type, $post->post_parent);
$post->post_name = wp_unique_post_slug($post->post_name, $post->ID, $post->post_status, $post->post_type, $post->post_parent);
// If the user wants to set a new name -- override the current one
// Note: if empty name is supplied -- use the title instead, see #6072
@ -1339,13 +1339,13 @@ function wp_tiny_mce( $teeny = false ) {
$language = $initArray['language'];
$zip = $compress_scripts ? 1 : 0;
/**
* Deprecated
*
*
* The tiny_mce_version filter is not needed since external plugins are loaded directly by TinyMCE.
* These plugins can be refreshed by appending query string to the URL passed to mce_external_plugins filter.
* If the plugin has a popup dialog, a query string can be added to the button action that opens it (in the plugin's code).
* If the plugin has a popup dialog, a query string can be added to the button action that opens it (in the plugin's code).
*/
$version = apply_filters('tiny_mce_version', '');
$version = 'ver=' . $tinymce_version . $version;

View File

@ -303,7 +303,7 @@ function populate_options() {
'widget_categories' => array(),
'widget_text' => array(),
'widget_rss' => array(),
// 2.8
'timezone_string' => ''
);

View File

@ -21,25 +21,25 @@
* @param unknown_type $per_page
*/
function cat_rows( $parent = 0, $level = 0, $categories = 0, $page = 1, $per_page = 20 ) {
$count = 0;
if ( empty($categories) ) {
$args = array('hide_empty' => 0);
if ( !empty($_GET['s']) )
$args['search'] = $_GET['s'];
$categories = get_categories( $args );
$categories = get_categories( $args );
if ( empty($categories) )
return false;
}
$children = _get_term_hierarchy('category');
_cat_rows( $parent, $level, $categories, $children, $page, $per_page, $count );
$children = _get_term_hierarchy('category');
_cat_rows( $parent, $level, $categories, $children, $page, $per_page, $count );
}
/**
@ -55,22 +55,22 @@ function cat_rows( $parent = 0, $level = 0, $categories = 0, $page = 1, $per_pag
* @param unknown_type $per_page
* @return unknown
*/
function _cat_rows( $parent = 0, $level = 0, $categories, &$children, $page = 1, $per_page = 20, &$count ) {
function _cat_rows( $parent = 0, $level = 0, $categories, &$children, $page = 1, $per_page = 20, &$count ) {
$start = ($page - 1) * $per_page;
$end = $start + $per_page;
ob_start();
foreach ( $categories as $key => $category ) {
if ( $count >= $end )
break;
if ( $category->parent != $parent && empty($_GET['s']) )
continue;
// If the page starts in a subtree, print the parents.
if ( $count == $start && $category->parent > 0 ) {
$my_parents = array();
$p = $category->parent;
while ( $p ) {
@ -80,7 +80,7 @@ function _cat_rows( $parent = 0, $level = 0, $categories, &$children, $page = 1,
break;
$p = $my_parent->parent;
}
$num_parents = count($my_parents);
while( $my_parent = array_pop($my_parents) ) {
echo "\t" . _cat_row( $my_parent, $level - $num_parents );
@ -91,12 +91,12 @@ function _cat_rows( $parent = 0, $level = 0, $categories, &$children, $page = 1,
if ( $count >= $start )
echo "\t" . _cat_row( $category, $level );
unset( $categories[ $key ] );
unset( $categories[ $key ] );
$count++;
if ( isset($children[$category->term_id]) )
_cat_rows( $category->term_id, $level + 1, $categories, $children, $page, $per_page, $count );
_cat_rows( $category->term_id, $level + 1, $categories, $children, $page, $per_page, $count );
}
$output = ob_get_contents();
@ -517,13 +517,13 @@ function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $select
// Post process $categories rather than adding an exclude to the get_terms() query to keep the query the same across all posts (for any query cache)
$checked_categories = array();
$keys = array_keys( $categories );
$keys = array_keys( $categories );
foreach( $keys as $k ) {
if ( in_array( $categories[$k]->term_id, $args['selected_cats'] ) ) {
$checked_categories[] = $categories[$k];
unset( $categories[$k] );
}
}
}
// Put checked cats on top
@ -3598,7 +3598,7 @@ function screen_layout($screen) {
$screen_layout_columns = 0;
return '';
}
$screen_layout_columns = get_user_option("screen_layout_$screen");
$num = $columns[$screen];

View File

@ -154,7 +154,7 @@ function wp_plugin_update_row( $file, $plugin_data ) {
$plugins_allowedtags = array('a' => array('href' => array(),'title' => array()),'abbr' => array('title' => array()),'acronym' => array('title' => array()),'code' => array(),'em' => array(),'strong' => array());
$plugin_name = wp_kses( $plugin_data['Name'], $plugins_allowedtags );
$details_url = admin_url('plugin-install.php?tab=plugin-information&plugin=' . $r->slug . '&TB_iframe=true&width=600&height=800');
echo '<tr><td colspan="3" class="plugin-update"><div class="update-message">';
@ -164,9 +164,9 @@ function wp_plugin_update_row( $file, $plugin_data ) {
printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s Details</a> <em>automatic upgrade unavailable for this plugin</em>.'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r->new_version );
else
printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s Details</a> or <a href="%5$s">upgrade automatically</a>.'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r->new_version, wp_nonce_url('update.php?action=upgrade-plugin&plugin=' . $file, 'upgrade-plugin_' . $file) );
do_action( "in_plugin_update_message-$file", $plugin_data, $r );
echo '</div></td></tr>';
}
add_action( 'after_plugin_row', 'wp_plugin_update_row', 10, 2 );

View File

@ -179,8 +179,8 @@ function edit_user( $user_id = 0 ) {
}
// Allow plugins to return there own errors.
do_action_ref_array('user_profile_update_errors', array ( &$errors, $update, &$user ) );
do_action_ref_array('user_profile_update_errors', array ( &$errors, $update, &$user ) );
if ( $errors->get_error_codes() )
return $errors;
@ -803,7 +803,7 @@ function default_password_nag_handler($errors = false) {
return;
//get_user_setting = JS saved UI setting. else no-js-falback code.
if ( 'hide' == get_user_setting('default_password_nag') || isset($_GET['default_password_nag']) && '0' == $_GET['default_password_nag'] ) {
if ( 'hide' == get_user_setting('default_password_nag') || isset($_GET['default_password_nag']) && '0' == $_GET['default_password_nag'] ) {
delete_user_setting('default_password_nag');
update_usermeta($user_ID, 'default_password_nag', false);
}

View File

@ -137,7 +137,7 @@ showNotice = {
jQuery(document).ready( function($) {
var lastClicked = false, checks, first, last, checked;
// pulse
$('.fade').animate( { backgroundColor: '#ffffe0' }, 300).animate( { backgroundColor: '#fffbcc' }, 300).animate( { backgroundColor: '#ffffe0' }, 300).animate( { backgroundColor: '#fffbcc' }, 300);

View File

@ -1,6 +1,6 @@
jQuery(document).ready( function($) {
var before, addBefore, addAfter, delBefore;
before = function() {
var nonce = $('#newmeta [name=_ajax_nonce]').val(), postId = $('#post_ID').val();
if ( !nonce || !postId ) { return false; }

View File

@ -3,7 +3,7 @@ var theList, theExtraList, toggleWithKeyboard = false;
setCommentsList = function() {
var totalInput, perPageInput, pageInput, lastConfidentTime = 0, dimAfter, delBefore, updateTotalCount, delAfter;
totalInput = $('#comments-form .tablenav :input[name="_total"]');
perPageInput = $('#comments-form .tablenav :input[name="_per_page"]');
pageInput = $('#comments-form .tablenav :input[name="_page"]');
@ -101,7 +101,7 @@ setCommentsList = function() {
a.html(n);
});
// XML response
if ( ( 'object' == typeof r ) && lastConfidentTime < settings.parsed.responses[0].supplemental.time ) {
// Set the total to the known good value (even if this value is a little old, newer values should only be a few less, and so shouldn't mess up the page links)
@ -156,7 +156,7 @@ commentReply = {
if ( $('#the-comment-list #replyrow').length > 0 )
commentReply.close();
});
this.comments_listing = $('#comments-form > input[name="comment_status"]').val() || '';
},
@ -250,7 +250,7 @@ commentReply = {
setTimeout(function() {
var rtop, rbottom, scrollTop, vp, scrollBottom;
rtop = $('#replyrow').offset().top;
rbottom = rtop + $('#replyrow').height();
scrollTop = window.pageYOffset || document.documentElement.scrollTop;
@ -316,7 +316,7 @@ commentReply = {
$(c).hide()
$('#replyrow').after(c);
this.o = id = '#comment-'+r.id;
this.revert();
this.addEvents($(id));
@ -357,7 +357,7 @@ $(document).ready(function(){
make_hotkeys_redirect = function(which) {
return function() {
var first_last, l;
first_last = 'next' == which? 'first' : 'last';
l = $('.'+which+'.page-numbers');
if (l.length)

View File

@ -192,7 +192,7 @@ inlineEditPost = {
save : function(id) {
var params, fields;
if( typeof(id) == 'object' )
id = this.getId(id);

View File

@ -64,7 +64,7 @@ inlineEditTax = {
save : function(id) {
var params, fields, tax = $('input[name="taxonomy"]').val() || '';
if( typeof(id) == 'object' )
id = this.getId(id);

View File

@ -1,7 +1,7 @@
// send html to the post editor
function send_to_editor(h) {
var ed;
if ( typeof tinyMCE != 'undefined' && ( ed = tinyMCE.activeEditor ) && !ed.isHidden() ) {
ed.focus();
if (tinymce.isIE)

View File

@ -22,7 +22,7 @@ jQuery(document).ready( function($) {
function updateText() {
var attemptedDate, originalDate, currentDate, publishOn;
attemptedDate = new Date( $('#aa').val(), $('#mm').val() -1, $('#jj').val(), $('#hh').val(), $('#mn').val());
originalDate = new Date( $('#hidden_aa').val(), $('#hidden_mm').val() -1, $('#hidden_jj').val(), $('#hidden_hh').val(), $('#hidden_mn').val());
currentDate = new Date( $('#cur_aa').val(), $('#cur_mm').val() -1, $('#cur_jj').val(), $('#cur_hh').val(), $('#cur_mn').val());

View File

@ -36,7 +36,7 @@ function tag_update_quickclicks(taxbox) {
jQuery.each( current_tags, function( key, val ) {
var txt, button_id;
val = jQuery.trim(val);
if ( !val.match(/^\s+$/) && '' != val ) {
button_id = jQuery(taxbox).attr('id') + '-check-num-' + key;
@ -52,7 +52,7 @@ function tag_update_quickclicks(taxbox) {
function tag_flush_to_text(id, a) {
a = a || false;
var taxbox, text, tags, newtags;
taxbox = jQuery('#'+id);
text = a ? jQuery(a).text() : taxbox.find('input.newtag').val();
@ -68,7 +68,7 @@ function tag_flush_to_text(id, a) {
newtags = array_unique_noempty(newtags.split(',')).join(',');
taxbox.find('.the-tags').val(newtags);
tag_update_quickclicks(taxbox);
if ( ! a )
taxbox.find('input.newtag').val('').focus();
@ -317,7 +317,7 @@ jQuery(document).ready( function($) {
function updateText() {
var attemptedDate, originalDate, currentDate, publishOn;
attemptedDate = new Date( $('#aa').val(), $('#mm').val() -1, $('#jj').val(), $('#hh').val(), $('#mn').val());
originalDate = new Date( $('#hidden_aa').val(), $('#hidden_mm').val() -1, $('#hidden_jj').val(), $('#hidden_hh').val(), $('#hidden_mn').val());
currentDate = new Date( $('#cur_aa').val(), $('#cur_mm').val() -1, $('#cur_jj').val(), $('#cur_hh').val(), $('#cur_mn').val());

View File

@ -18,7 +18,7 @@ jQuery(document).ready(function($) {
if ( id == options[o].value )
options[o] = null;
}
delBefore = function(s) {
s.data.taxonomy = $('input[name="taxonomy"]').val();

View File

@ -23,12 +23,12 @@ jQuery(document).ready(function($) {
$('a.thickbox-preview').click( function() {
var alink = $(this).parents('.available-theme').find('.activatelink'), link = '', href = $(this).attr('href'), url, text;
if ( tbWidth = href.match(/&tbWidth=[0-9]+/) )
if ( tbWidth = href.match(/&tbWidth=[0-9]+/) )
tbWidth = parseInt(tbWidth[0].replace(/[^0-9]+/g, ''), 10);
else
tbWidth = $(window).width() - 90;
if ( tbHeight = href.match(/&tbHeight=[0-9]+/) )
if ( tbHeight = href.match(/&tbHeight=[0-9]+/) )
tbHeight = parseInt(tbHeight[0].replace(/[^0-9]+/g, ''), 10);
else
tbHeight = $(window).height() - 60;

View File

@ -134,7 +134,7 @@ function getUserSetting( name, def ) {
function setUserSetting( name, value, del ) {
if ( 'object' !== typeof userSettings )
return false;
var c = 'wp-settings-' + userSettings.uid, o = wpCookies.getHash(c) || {}, d = new Date(), p,
n = name.toString().replace(/[^A-Za-z0-9_]/, ''), v = value.toString().replace(/[^A-Za-z0-9_]/, '');
@ -149,7 +149,7 @@ function setUserSetting( name, value, del ) {
wpCookies.setHash(c, o, d, p);
wpCookies.set('wp-settings-time-'+userSettings.uid, userSettings.time, d, p);
return name;
}

View File

@ -233,9 +233,9 @@ if ( $links ) {
case 'visible':
?><td <?php echo $attributes ?>><?php echo $visible; ?></td><?php
break;
case 'rating':
?><td <?php echo $attributes ?>><?php echo $rating; ?></td><?php
break;
case 'rating':
?><td <?php echo $attributes ?>><?php echo $rating; ?></td><?php
break;
default:
?>
<td><?php do_action('manage_link_custom_column', $column_name, $link->link_id); ?></td>

View File

@ -128,7 +128,7 @@ do_action('_admin_menu');
// Create list of page plugin hook names.
foreach ($menu as $menu_page) {
$hook_name = sanitize_title(basename($menu_page[2], '.php'));
// ensure we're backwards compatible
$compat = array(
'index' => 'dashboard',
@ -140,12 +140,12 @@ foreach ($menu as $menu_page) {
'options-general' => 'settings',
'themes' => 'appearance',
);
if ( isset($compat[$hook_name]) )
$hook_name = $compat[$hook_name];
elseif ( !$hook_name )
continue;
$admin_page_hooks[$menu_page[2]] = $hook_name;
}

View File

@ -228,9 +228,9 @@ $structures = array(
<?php wp_nonce_field('update-permalink') ?>
<p><textarea rows="10" class="large-text readonly" name="rules" id="rules" readonly="readonly"><?php echo esc_html($wp_rewrite->iis7_url_rewrite_rules()); ?></textarea></p>
</form>
<p><?php _e('If you temporarily make your <code>web.config</code> file writable for us to generate rewrite rules automatically, do not forget to revert the permissions after rule has been saved.') ?></p>
<p><?php _e('If you temporarily make your <code>web.config</code> file writable for us to generate rewrite rules automatically, do not forget to revert the permissions after rule has been saved.') ?></p>
<?php endif; ?>
<?php else :
<?php else :
if ( $permalink_structure && ! $usingpi && ! $writable ) : ?>
<p><?php _e('If your <code>.htaccess</code> file were <a href="http://codex.wordpress.org/Changing_File_Permissions">writable</a>, we could do this automatically, but it isn&#8217;t so these are the mod_rewrite rules you should have in your <code>.htaccess</code> file. Click in the field and press <kbd>CTRL + a</kbd> to select all.') ?></p>
<form action="options-permalink.php" method="post">

View File

@ -84,8 +84,8 @@ default:
}
wp_enqueue_script( 'codepress' );
add_action( 'admin_print_footer_scripts', 'codepress_footer_js' );
add_action( 'admin_print_footer_scripts', 'codepress_footer_js' );
// List of allowable extensions
$editable_extensions = array('php', 'txt', 'text', 'js', 'css', 'html', 'htm', 'xml', 'inc', 'include');
$editable_extensions = (array) apply_filters('editable_extensions', $editable_extensions);
@ -101,9 +101,9 @@ default:
wp_die(sprintf('<p>%s</p>', __('Files of this type are not editable.')));
}
}
require_once('admin-header.php');
update_recently_edited(WP_PLUGIN_DIR . '/' . $file);
$content = file_get_contents( $real_file );

View File

@ -410,7 +410,7 @@ function print_plugins_table($plugins, $context = '') {
echo implode(' | ', $plugin_meta);
echo "</p></td>
</tr>\n";
do_action( 'after_plugin_row', $plugin_file, $plugin_data, $context );
do_action( "after_plugin_row_$plugin_file", $plugin_file, $plugin_data, $context );
}

View File

@ -69,13 +69,13 @@ function retrieve_widgets() {
$_sidebars_widgets['wp_inactive_widgets'] = array_merge( (array) $_sidebars_widgets['wp_inactive_widgets'], $val );
}
}
// discard invalid, theme-specific widgets from sidebars
$shown_widgets = array();
foreach ( $_sidebars_widgets as $sidebar => $widgets ) {
if ( !is_array($widgets) )
continue;
$_widgets = array();
foreach ( $widgets as $widget ) {
if ( isset($wp_registered_widgets[$widget]) )
@ -220,7 +220,7 @@ if ( isset($_GET['editwidget']) && $_GET['editwidget'] ) {
if ( !isset($name) )
$name = esc_html( strip_tags($control['name']) );
if ( !isset($sidebar) )
$sidebar = isset($_GET['sidebar']) ? $_GET['sidebar'] : 'wp_inactive_widgets';
@ -242,7 +242,7 @@ if ( isset($_GET['editwidget']) && $_GET['editwidget'] ) {
<form action="widgets.php" method="post">
<div class="widget-inside">
<?php
<?php
if ( is_callable( $control_callback ) )
call_user_func_array( $control_callback, $control['params'] );
else

View File

@ -80,13 +80,13 @@ function the_modified_author() {
}
/**
* Retrieve the requested data of the author of the current post.
* @link http://codex.wordpress.org/Template_Tags/the_author_meta
* @since 2.8.0
* Retrieve the requested data of the author of the current post.
* @link http://codex.wordpress.org/Template_Tags/the_author_meta
* @since 2.8.0
* @uses $authordata The current author's DB object (if $user_id not specified).
* @param string $field selects the field of the users record.
* @param string $field selects the field of the users record.
* @param int $user_id Optional. User ID.
* @return string The author's field from the current author's DB object.
* @return string The author's field from the current author's DB object.
*/
function get_the_author_meta($field = '', $user_id = false) {
if ( ! $user_id )
@ -96,7 +96,7 @@ function get_the_author_meta($field = '', $user_id = false) {
$field = strtolower($field);
$user_field = "user_$field";
if ( 'id' == $field )
$value = isset($authordata->ID) ? (int)$authordata->ID : 0;
elseif ( isset($authordata->$user_field) )
@ -108,12 +108,12 @@ function get_the_author_meta($field = '', $user_id = false) {
}
/**
* Retrieve the requested data of the author of the current post.
* @link http://codex.wordpress.org/Template_Tags/the_author_meta
* @since 2.8.0
* @param string $field selects the field of the users record.
* Retrieve the requested data of the author of the current post.
* @link http://codex.wordpress.org/Template_Tags/the_author_meta
* @since 2.8.0
* @param string $field selects the field of the users record.
* @param int $user_id Optional. User ID.
* @echo string The author's field from the current author's DB object.
* @echo string The author's field from the current author's DB object.
*/
function the_author_meta($field = '', $user_id = false) {
echo apply_filters('the_author_' . $field, get_the_author_meta($field, $user_id));

View File

@ -575,7 +575,7 @@ function default_topic_count_text( $count ) {
*
* The 'tag_cloud_sort' filter allows you to override the sorting done
* by the 'orderby' argument; passed to the filter: $tags array and $args array.
*
*
* The 'orderby' argument will accept 'name' or 'count' and defaults to 'name'.
* The 'order' is the direction to sort, defaults to 'ASC' and can be 'DESC' or
* 'RAND'.
@ -623,7 +623,7 @@ function wp_generate_tag_cloud( $tags, $args = '' ) {
uasort( $tags, create_function('$a, $b', 'return ($a->count > $b->count);') );
$tags = apply_filters( 'tag_cloud_sort', $tags, $args );
if ( 'DESC' == $order )
$tags = array_reverse( $tags, true );
elseif ( 'RAND' == $order ) {

View File

@ -89,7 +89,7 @@ class WP_Dependencies {
continue;
$moved = $this->set_group( $handle, $recursion, $group );
if ( $queued && !$moved ) // already queued and in the right group
continue;

View File

@ -169,7 +169,7 @@ function &get_comment(&$comment, $output = OBJECT) {
* Retrieve a list of comments.
*
* The comment list can be for the blog as a whole or for an individual post.
*
*
* The list of comment arguments are 'status', 'orderby', 'comment_date_gmt',
* 'order', 'number', 'offset', and 'post_id'.
*

View File

@ -189,7 +189,7 @@ class WP_Widget_Search extends WP_Widget {
echo $after_widget;
}
function form( $instance ) {
$instance = wp_parse_args( (array) $instance, array( 'title' => '') );
$title = $instance['title'];
@ -197,14 +197,14 @@ class WP_Widget_Search extends WP_Widget {
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></label></p>
<?php
}
function update( $new_instance, $old_instance ) {
$instance = $old_instance;
$new_instance = wp_parse_args((array) $new_instance, array( 'title' => ''));
$instance['title'] = strip_tags($new_instance['title']);
return $instance;
}
}
}
/**

View File

@ -1672,7 +1672,7 @@ function the_author_url() {
* @deprecated 2.8
* @return int The author's ID.
*/
function get_the_author_ID() {
function get_the_author_ID() {
_deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'ID\')' );
return get_the_author_meta('ID');
}
@ -1685,9 +1685,9 @@ function get_the_author_ID() {
* @deprecated 2.8
* @uses get_the_author_ID()
*/
function the_author_ID() {
function the_author_ID() {
_deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'ID\')' );
the_author_meta('ID');
}
}
?>

View File

@ -172,7 +172,7 @@ function wpautop($pee, $br = 1) {
/**
* Checks to see if a string is utf8 encoded.
*
* NOTE: This function checks for 5-Byte sequences, UTF8
* NOTE: This function checks for 5-Byte sequences, UTF8
* has Bytes Sequences with a maximum length of 4.
*
* @author bmorel at ssi dot fr (modified)
@ -184,7 +184,7 @@ function wpautop($pee, $br = 1) {
function seems_utf8(&$str) {
$length = strlen($str);
for ($i=0; $i < $length; $i++) {
$c = ord($str[$i]);
$c = ord($str[$i]);
if ($c < 0x80) $n = 0; # 0bbbbbbb
elseif (($c & 0xE0) == 0xC0) $n=1; # 110bbbbb
elseif (($c & 0xF0) == 0xE0) $n=2; # 1110bbbb
@ -256,7 +256,7 @@ function _wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = fals
} elseif ( $quote_style === 'single' ) {
$quote_style = ENT_NOQUOTES;
}
// Handle double encoding ourselves
if ( !$double_encode ) {
$string = wp_specialchars_decode( $string, $_quote_style );
@ -581,9 +581,9 @@ function remove_accents($string) {
/**
* Sanitizes a filename replacing whitespace with dashes
*
* Removes special characters that are illegal in filenames on certain
* operating systems and special characters requiring special escaping
* to manipulate at the command line. Replaces spaces and consecutive
* Removes special characters that are illegal in filenames on certain
* operating systems and special characters requiring special escaping
* to manipulate at the command line. Replaces spaces and consecutive
* dashes with a single dash. Trim period, dash and underscore from beginning
* and end of filename.
*
@ -720,14 +720,14 @@ function sanitize_sql_orderby( $orderby ){
/**
* Santizes a html classname to ensure it only contains valid characters
*
*
* Strips the string down to A-Z,a-z,0-9,'-' if this results in an empty
* string then it will return the alternative value supplied.
*
*
* @todo Expand to support the full range of CDATA that a class attribute can contain.
*
*
* @since 2.8.0
*
*
* @param string $class The classname to be sanitized
* @param string $fallback The value to return if the sanitization end's up as an empty string.
* @return string The sanitized value
@ -735,14 +735,14 @@ function sanitize_sql_orderby( $orderby ){
function sanitize_html_class($class, $fallback){
//Strip out any % encoded octets
$sanitized = preg_replace('|%[a-fA-F0-9][a-fA-F0-9]|', '', $class);
//Limit to A-Z,a-z,0-9,'-'
$sanitized = preg_replace('/[^A-Za-z0-9-]/', '', $sanitized);
if ('' == $sanitized)
$sanitized = $fallback;
return apply_filters('sanitize_html_class',$sanitized, $class, $fallback);
return apply_filters('sanitize_html_class',$sanitized, $class, $fallback);
}
/**
@ -2215,7 +2215,7 @@ function esc_attr( $text ) {
*
* @deprecated 2.8.0
* @see esc_attr()
*
*
* @param string $text
* @return string
*/

View File

@ -141,7 +141,7 @@ function number_format_i18n( $number, $decimals = null ) {
$decimals = ( is_null( $decimals ) ) ? $wp_locale->number_format['decimals'] : intval( $decimals );
$num = number_format( $number, $decimals, $wp_locale->number_format['decimal_point'], $wp_locale->number_format['thousands_sep'] );
// let the user translate digits from latin to localized language
return apply_filters( 'number_format_i18n', $num );
}
@ -479,7 +479,7 @@ function wp_load_alloptions() {
* parameter value, will be called. The hook should accept two parameters, the
* first is the new value and the second is the old value. Whatever is
* returned will be used as the new value.
*
*
* After the value has been updated the action named 'update_option_$option_name'
* will be called. This action receives two parameters the first being the old
* value and the second the new value.
@ -2035,7 +2035,7 @@ function wp_unique_filename( $dir, $filename, $unique_filename_callback = null )
$info = pathinfo($filename);
$ext = !empty($info['extension']) ? $info['extension'] : '';
$name = basename($filename, ".{$ext}");
// edge case: if file is named '.ext', treat as an empty name
if( $name === ".$ext" )
$name = '';
@ -2366,7 +2366,7 @@ function wp_die( $message, $title = '', $args = array() ) {
$defaults = array( 'response' => 500 );
$r = wp_parse_args($args, $defaults);
$have_gettext = function_exists('__');
if ( function_exists( 'is_wp_error' ) && is_wp_error( $message ) ) {
@ -2390,12 +2390,12 @@ function wp_die( $message, $title = '', $args = array() ) {
} elseif ( is_string( $message ) ) {
$message = "<p>$message</p>";
}
if ( isset( $r['back_link'] ) && $r['back_link'] ) {
$back_text = $have_gettext? __('&laquo; Back') : '&laquo; Back';
$message .= "\n<p><a href='javascript:history.back()'>$back_text</p>";
}
if ( defined( 'WP_SITEURL' ) && '' != WP_SITEURL )
$admin_dir = WP_SITEURL . '/wp-admin/';
elseif ( function_exists( 'get_bloginfo' ) && '' != get_bloginfo( 'wpurl' ) )
@ -2411,7 +2411,7 @@ function wp_die( $message, $title = '', $args = array() ) {
nocache_headers();
header( 'Content-Type: text/html; charset=utf-8' );
}
if ( empty($title) ) {
$title = $have_gettext? __('WordPress &rsaquo; Error') : 'WordPress &rsaquo; Error';
}
@ -2683,9 +2683,9 @@ function wp_widgets_add_menu() {
* @since 2.2.0
*/
function wp_ob_end_flush_all() {
$levels = ob_get_level();
for ($i=0; $i<$levels; $i++)
ob_end_flush();
$levels = ob_get_level();
for ($i=0; $i<$levels; $i++)
ob_end_flush();
}
/**
@ -3164,7 +3164,7 @@ function wp_timezone_choice($selectedzone) {
else
return strnatcasecmp($a_continent, $b_continent);
'));
$structure = '';
$pad = '&nbsp;&nbsp;&nbsp;';

View File

@ -208,7 +208,7 @@ function wp_login_url($redirect = '') {
* @param string $redirect Path to redirect to on login.
*/
function wp_lostpassword_url($redirect = '') {
$args = array( 'action' => 'lostpassword' );
$args = array( 'action' => 'lostpassword' );
if ( !empty($redirect) ) {
$args['redirect_to'] = $redirect;
}

View File

@ -281,7 +281,7 @@ class WP_Http {
$transports = WP_Http::_getTransport($r);
} else {
if ( is_array( $r['body'] ) || is_object( $r['body'] ) ) {
if ( ! version_compare(phpversion(), '5.1.2', '>=') )
if ( ! version_compare(phpversion(), '5.1.2', '>=') )
$r['body'] = _http_build_query($r['body'], null, '&');
else
$r['body'] = http_build_query($r['body'], null, '&');

View File

@ -1433,17 +1433,17 @@ function previous_posts_link( $label = '&laquo; Previous Page' ) {
* @since 2.8
*
* @param string|array $args Optional args.
* @return string The posts link navigation.
* @return string The posts link navigation.
*/
function get_posts_nav_link( $args = array() ) {
global $wp_query;
$return = '';
if ( !is_singular() ) {
$defaults = array(
'sep' => ' &#8212; ',
'prelabel' => __('&laquo; Previous Page'),
'sep' => ' &#8212; ',
'prelabel' => __('&laquo; Previous Page'),
'nxtlabel' => __('Next Page &raquo;'),
);
$args = wp_parse_args( $args, $defaults );

View File

@ -610,7 +610,7 @@ add_shortcode('gallery', 'gallery_shortcode');
*/
function gallery_shortcode($attr) {
global $post;
static $instance = 0;
$instance++;
@ -654,7 +654,7 @@ function gallery_shortcode($attr) {
$captiontag = tag_escape($captiontag);
$columns = intval($columns);
$itemwidth = $columns > 0 ? floor(100/$columns) : 100;
$selector = "gallery-{$instance}";
$output = apply_filters('gallery_style', "

View File

@ -954,7 +954,7 @@ function wp_notify_postauthor($comment_id, $comment_type='') {
$current_user = wp_get_current_user();
if ( $comment->user_id == $post->post_author ) return false; // The author moderated a comment on his own post
if ('' == $user->user_email) return false; // If there's no email to send the comment to
$comment_author_domain = @gethostbyaddr($comment->comment_author_IP);

View File

@ -311,7 +311,7 @@ function get_post_class( $class = '', $post_id = null ) {
$post = get_post($post_id);
$classes = array();
$classes[] = 'post-' . $post->ID;
$classes[] = $post->post_type;

View File

@ -1197,8 +1197,8 @@ function wp_delete_post($postid = 0) {
clean_post_cache($postid);
}
wp_clear_scheduled_hook('publish_future_post', $postid);
wp_clear_scheduled_hook('publish_future_post', $postid);
do_action('deleted_post', $postid);
return $post;
@ -1734,7 +1734,7 @@ function check_and_publish_future_post($post_id) {
* @param string $post_status no uniqueness checks are made if the post is still draft or pending
* @param string $post_type
* @param integer $post_parent
* @return string unique slug for the post, based on $post_name (with a -1, -2, etc. suffix)
* @return string unique slug for the post, based on $post_name (with a -1, -2, etc. suffix)
*/
function wp_unique_post_slug($slug, $post_ID, $post_status, $post_type, $post_parent) {
global $wpdb, $wp_rewrite;
@ -1747,7 +1747,7 @@ function wp_unique_post_slug($slug, $post_ID, $post_status, $post_type, $post_pa
$check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type = %s AND ID != %d AND post_parent = %d LIMIT 1";
$post_name_check = $wpdb->get_var($wpdb->prepare($check_sql, $slug, $post_type, $post_ID, $post_parent));
}
if ( $post_name_check || in_array($slug, $wp_rewrite->feeds) ) {
$suffix = 2;
do {

View File

@ -1908,7 +1908,7 @@ class WP_Query {
foreach ($intersections as $item => $taxonomy) {
if ( empty($q[$item]) ) continue;
if ( in_array($item, $tagin) && empty($q['cat']) ) continue; // We should already have what we need if categories aren't being used
if ( $item != 'category__and' ) {
$reqtag = is_term( $q[$item][0], 'post_tag' );
if ( !empty($reqtag) )
@ -2662,7 +2662,7 @@ function setup_postdata($post) {
global $id, $authordata, $day, $currentmonth, $page, $pages, $multipage, $more, $numpages;
do_action_ref_array('the_post', array(&$post));
$id = (int) $post->ID;
$authordata = get_userdata($post->post_author);

View File

@ -1703,20 +1703,20 @@ class WP_Rewrite {
return $rules;
}
/**
* Retrieve IIS7 URL Rewrite formatted rewrite rules to write to web.config file.
*
* Does not actually write to the web.config file, but creates the rules for
* the process that will.
*
* @since 2.8.0
* @since 2.8.0
* @access public
*
* @return string
*/
function iis7_url_rewrite_rules(){
if ( ! $this->using_permalinks()) {
return '';
}
@ -1728,9 +1728,9 @@ class WP_Rewrite {
$rules .= " </conditions>\n";
$rules .= " <action type=\"Rewrite\" url=\"index.php\" />\n";
$rules .= "</rule>";
$rules = apply_filters('iis7_url_rewrite_rules', $rules);
return $rules;
}
@ -1874,7 +1874,7 @@ class WP_Rewrite {
* Will update the 'permalink_structure' option, if there is a difference
* between the current permalink structure and the parameter value. Calls
* {@link WP_Rewrite::init()} after the option is updated.
*
*
* Fires the 'permalink_structure_changed' action once the init call has
* processed passing the old and new values
*

View File

@ -422,7 +422,7 @@ function wp_default_styles( &$styles ) {
// all colors stylesheets need to have the same query strings (cache manifest compat)
$colors_version = '20090522';
$styles->add( 'wp-admin', '/wp-admin/wp-admin.css', array(), '20090522' );
$styles->add_data( 'wp-admin', 'rtl', '/wp-admin/rtl.css' );

View File

@ -15,9 +15,9 @@
* Creates the initial taxonomies when 'init' action is fired.
*/
function create_initial_taxonomies() {
register_taxonomy( 'category', 'post', array('hierarchical' => true, 'update_count_callback' => '_update_post_term_count', 'label' => __('Categories'), 'query_var' => false, 'rewrite' => false) ) ;
register_taxonomy( 'post_tag', 'post', array('hierarchical' => false, 'update_count_callback' => '_update_post_term_count', 'label' => __('Post Tags'), 'query_var' => false, 'rewrite' => false) ) ;
register_taxonomy( 'link_category', 'link', array('hierarchical' => false, 'label' => __('Categories'), 'query_var' => false, 'rewrite' => false) ) ;
register_taxonomy( 'category', 'post', array('hierarchical' => true, 'update_count_callback' => '_update_post_term_count', 'label' => __('Categories'), 'query_var' => false, 'rewrite' => false) ) ;
register_taxonomy( 'post_tag', 'post', array('hierarchical' => false, 'update_count_callback' => '_update_post_term_count', 'label' => __('Post Tags'), 'query_var' => false, 'rewrite' => false) ) ;
register_taxonomy( 'link_category', 'link', array('hierarchical' => false, 'label' => __('Categories'), 'query_var' => false, 'rewrite' => false) ) ;
}
add_action( 'init', 'create_initial_taxonomies', 0 ); // highest priority
@ -167,7 +167,7 @@ function is_taxonomy_hierarchical($taxonomy) {
function register_taxonomy( $taxonomy, $object_type, $args = array() ) {
global $wp_taxonomies, $wp_rewrite, $wp;
if (!is_array($wp_taxonomies))
if (!is_array($wp_taxonomies))
$wp_taxonomies = array();
$defaults = array('hierarchical' => false, 'update_count_callback' => '', 'rewrite' => true, 'query_var' => true);
@ -525,7 +525,7 @@ function get_term_to_edit( $id, $taxonomy ) {
* The 'list_terms_exclusions' filter passes the compiled exclusions along with
* the $args.
*
* The 'get_terms_orderby' filter passes the ORDER BY clause for the query
* The 'get_terms_orderby' filter passes the ORDER BY clause for the query
* along with the $args array.
* The 'get_terms_fields' filter passes the fields for the SELECT query
@ -533,10 +533,10 @@ function get_term_to_edit( $id, $taxonomy ) {
*
* The list of arguments that $args can contain, which will overwrite the defaults:
*
* orderby - Default is 'name'. Can be name, count, term_group, slug or nothing
* orderby - Default is 'name'. Can be name, count, term_group, slug or nothing
* (will use term_id), Passing a custom value other than these will cause it to
* order based on the custom value.
*
*
* order - Default is ASC. Can use DESC.
*
* hide_empty - Default is true. Will not return empty terms, which means
@ -680,7 +680,7 @@ function &get_terms($taxonomies, $args = '') {
$orderby = 't.slug';
else if ( 'term_group' == $_orderby )
$orderby = 't.term_group';
elseif ( empty($_orderby) || 'id' == $_orderby )
elseif ( empty($_orderby) || 'id' == $_orderby )
$orderby = 't.term_id';
$orderby = apply_filters( 'get_terms_orderby', $orderby, $args );
@ -871,7 +871,7 @@ function is_term($term, $taxonomy = '', $parent = 0) {
}
$term = trim( stripslashes( $term ) );
if ( '' === $slug = sanitize_title($term) )
return 0;

View File

@ -884,7 +884,7 @@ function preview_theme() {
add_filter( 'stylesheet', create_function('', "return '{$_GET['stylesheet']}';") );
}
// Prevent theme mods to current theme being used on theme being previewed
// Prevent theme mods to current theme being used on theme being previewed
add_filter( 'pre_option_mods_' . get_current_theme(), create_function( '', "return array();" ) );
ob_start( 'preview_theme_ob_filter' );

View File

@ -173,7 +173,7 @@ class WP_Widget {
if ( array_key_exists( $this->number, $settings ) ) {
$settings = $settings[$this->number];
// filters the widget's settings, return false to stop displaying the widget
$settings = apply_filters('widget_display_callback', $settings, $this, $args);
$settings = apply_filters('widget_display_callback', $settings, $this, $args);
if ( false !== $settings )
$this->widget($args, $settings);
}
@ -285,7 +285,7 @@ class WP_Widget {
function get_settings() {
$settings = get_option($this->option_name);
if ( false === $settings && isset($this->alt_option_name) )
$settings = get_option($this->alt_option_name);
@ -772,9 +772,9 @@ function dynamic_sidebar($index = 1) {
$did_one = false;
foreach ( (array) $sidebars_widgets[$index] as $id ) {
if ( !isset($wp_registered_widgets[$id]) ) continue;
$params = array_merge(
array( array_merge( $sidebar, array('widget_id' => $id, 'widget_name' => $wp_registered_widgets[$id]['name']) ) ),
(array) $wp_registered_widgets[$id]['params']
@ -813,7 +813,7 @@ function dynamic_sidebar($index = 1) {
* in which the first instance of the widget with the given callback or $id_base is found.
* With the $widget_id parameter, returns the ID of the sidebar where
* the widget with that callback/$id_base AND that ID is found.
*
*
* NOTE: $widget_id and $id_base are the same for single widgets. To be effective
* this function has to run after widgets have initialized, at action 'init' or later.
*
@ -834,7 +834,7 @@ function is_active_widget($callback = false, $widget_id = false, $id_base = fals
foreach ( $sidebars_widgets as $sidebar => $widgets ) {
if ( $skip_inactive && 'wp_inactive_widgets' == $sidebar )
continue;
if ( is_array($widgets) ) {
foreach ( $widgets as $widget ) {
if ( ( $callback && isset($wp_registered_widgets[$widget]['callback']) && $wp_registered_widgets[$widget]['callback'] == $callback ) || ( $id_base && preg_replace( '/-[0-9]+$/', '', $widget ) == $id_base ) ) {
@ -878,8 +878,8 @@ function is_dynamic_sidebar() {
*/
function is_active_sidebar( $index ) {
$index = ( is_int($index) ) ? "sidebar-$index" : sanitize_title($index);
$sidebars_widgets = get_option( 'sidebars_widgets', array() );
if ( isset($sidebars_widgets[$index]) && !empty($sidebars_widgets[$index]) )
$sidebars_widgets = get_option( 'sidebars_widgets', array() );
if ( isset($sidebars_widgets[$index]) && !empty($sidebars_widgets[$index]) )
return true;
return false;
@ -1056,7 +1056,7 @@ function wp_convert_widget_settings($base_name, $option_name, $settings) {
$GLOBALS['_wp_sidebars_widgets'] = get_option('sidebars_widgets');
$sidebars_widgets = &$GLOBALS['_wp_sidebars_widgets'];
}
foreach ( (array) $sidebars_widgets as $index => $sidebar ) {
if ( is_array($sidebar) ) {
foreach ( $sidebar as $i => $name ) {

View File

@ -147,12 +147,12 @@ function retrieve_password() {
$message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n";
$message .= __('To reset your password visit the following address, otherwise just ignore this email and nothing will happen.') . "\r\n\r\n";
$message .= site_url("wp-login.php?action=rp&key=$key", 'login') . "\r\n";
$title = sprintf(__('[%s] Password Reset'), get_option('blogname'));
$title = apply_filters('retrieve_password_title', $title);
$message = apply_filters('retrieve_password_message', $message, $key);
if ( $message && !wp_mail($user_email, $title, $message) )
die('<p>' . __('The e-mail could not be sent.') . "<br />\n" . __('Possible reason: your host may have disabled the mail() function...') . '</p>');
@ -181,7 +181,7 @@ function reset_password($key) {
// Generate something random for a password...
$new_pass = wp_generate_password();
do_action('password_reset', $user, $new_pass);
wp_set_password($new_pass, $user->ID);
@ -194,7 +194,7 @@ function reset_password($key) {
$title = apply_filters('password_reset_title', $title);
$message = apply_filters('password_reset_message', $message, $new_pass);
if ( $message && !wp_mail($user->user_email, $title, $message) )
die('<p>' . __('The e-mail could not be sent.') . "<br />\n" . __('Possible reason: your host may have disabled the mail() function...') . '</p>');