Remove trailing whites.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7130 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -167,25 +167,25 @@ function get_the_category_list($separator = '', $parents='', $post_id = false) {
|
||||
return apply_filters('the_category', $thelist, $separator, $parents);
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* in_category() - Checks whether the current post is within a particular category
|
||||
*
|
||||
*
|
||||
* This function checks to see if the post is within the supplied category. The categoy
|
||||
* can be specified by number or name and will be checked as a name first to allow for categories with numeric names.
|
||||
* Note: Prior to v2.5 of WordPress category names where not supported.
|
||||
*
|
||||
* @since 1.2.0
|
||||
*
|
||||
* @param int|string $category
|
||||
*
|
||||
* @since 1.2.0
|
||||
*
|
||||
* @param int|string $category
|
||||
* @return bool true if the post is in the supplied category
|
||||
*/
|
||||
*/
|
||||
function in_category( $category ) { // Check if the current post is in the given category
|
||||
global $post;
|
||||
|
||||
$cat_ID = get_cat_ID($category);
|
||||
if (0 != $cat_ID)
|
||||
$category = $cat_ID;
|
||||
|
||||
|
||||
$categories = get_object_term_cache($post->ID, 'category');
|
||||
if ( false === $categories )
|
||||
$categories = wp_get_object_terms($post->ID, 'category');
|
||||
|
||||
@@ -416,34 +416,34 @@ class Walker {
|
||||
$cb_args = array_merge( array($output, $element, $depth), $args);
|
||||
$output = call_user_func_array(array(&$this, 'start_el'), $cb_args);
|
||||
|
||||
if ( $max_depth == 0 ||
|
||||
if ( $max_depth == 0 ||
|
||||
($max_depth != 0 && $max_depth > $depth+1 )) { //whether to descend
|
||||
|
||||
|
||||
for ( $i = 0; $i < sizeof( $children_elements ); $i++ ) {
|
||||
|
||||
|
||||
$child = $children_elements[$i];
|
||||
if ( $child->$parent_field == $element->$id_field ) {
|
||||
|
||||
if ( !isset($newlevel) ) {
|
||||
$newlevel = true;
|
||||
$newlevel = true;
|
||||
//start the child delimiter
|
||||
$cb_args = array_merge( array($output, $depth), $args);
|
||||
$output = call_user_func_array(array(&$this, 'start_lvl'), $cb_args);
|
||||
}
|
||||
|
||||
|
||||
array_splice( $children_elements, $i, 1 );
|
||||
$output = $this->display_element( $child, $children_elements, $max_depth, $depth + 1, $args, $output );
|
||||
$i = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( isset($newlevel) && $newlevel ){
|
||||
//end the child delimiter
|
||||
$cb_args = array_merge( array($output, $depth), $args);
|
||||
$output = call_user_func_array(array(&$this, 'end_lvl'), $cb_args);
|
||||
}
|
||||
|
||||
|
||||
//end this element
|
||||
$cb_args = array_merge( array($output, $element, $depth), $args);
|
||||
$output = call_user_func_array(array(&$this, 'end_el'), $cb_args);
|
||||
|
||||
@@ -1276,7 +1276,7 @@ function documentation_link( $deprecated = '' ) {
|
||||
|
||||
/**
|
||||
* gzip_compression() - Unused function
|
||||
*
|
||||
*
|
||||
* @deprecated 2.5
|
||||
*/
|
||||
|
||||
|
||||
@@ -5,14 +5,14 @@ function mysql2date( $dateformatstring, $mysqlstring, $translate = true ) {
|
||||
$m = $mysqlstring;
|
||||
if ( empty( $m ) )
|
||||
return false;
|
||||
|
||||
|
||||
if( 'G' == $dateformatstring ) {
|
||||
return gmmktime(
|
||||
(int) substr( $m, 11, 2 ), (int) substr( $m, 14, 2 ), (int) substr( $m, 17, 2 ),
|
||||
(int) substr( $m, 5, 2 ), (int) substr( $m, 8, 2 ), (int) substr( $m, 0, 4 )
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
$i = mktime(
|
||||
(int) substr( $m, 11, 2 ), (int) substr( $m, 14, 2 ), (int) substr( $m, 17, 2 ),
|
||||
(int) substr( $m, 5, 2 ), (int) substr( $m, 8, 2 ), (int) substr( $m, 0, 4 )
|
||||
@@ -906,7 +906,7 @@ function do_feed() {
|
||||
wp_die($message);
|
||||
}
|
||||
|
||||
do_action( $hook, $wp_query->is_comment_feed );
|
||||
do_action( $hook, $wp_query->is_comment_feed );
|
||||
}
|
||||
|
||||
|
||||
@@ -1043,7 +1043,7 @@ function path_is_absolute( $path ) {
|
||||
|
||||
if ( strlen($path) == 0 || $path{0} == '.' )
|
||||
return false;
|
||||
|
||||
|
||||
// windows allows absolute paths like this
|
||||
if ( preg_match('#^[a-zA-Z]:\\\\#', $path) )
|
||||
return true;
|
||||
@@ -1056,7 +1056,7 @@ function path_is_absolute( $path ) {
|
||||
function path_join( $base, $path ) {
|
||||
if ( path_is_absolute($path) )
|
||||
return $path;
|
||||
|
||||
|
||||
return rtrim($base, '/') . '/' . ltrim($path, '/');
|
||||
}
|
||||
|
||||
@@ -1064,7 +1064,7 @@ function path_join( $base, $path ) {
|
||||
function wp_upload_dir( $time = NULL ) {
|
||||
$siteurl = get_option( 'siteurl' );
|
||||
$upload_path = $dir = get_option( 'upload_path' );
|
||||
|
||||
|
||||
// $dir is absolute, $path is (maybe) relative to ABSPATH
|
||||
$dir = path_join( ABSPATH, $upload_path );
|
||||
$path = str_replace( ABSPATH, '', trim( $upload_path ) );
|
||||
@@ -1089,7 +1089,7 @@ function wp_upload_dir( $time = NULL ) {
|
||||
$m = substr( $time, 5, 2 );
|
||||
$subdir = "/$y/$m";
|
||||
}
|
||||
|
||||
|
||||
$dir .= $subdir;
|
||||
$url .= $subdir;
|
||||
|
||||
@@ -1184,7 +1184,7 @@ function wp_ext2type( $ext ) {
|
||||
'interactive' => array('ppt','key','odp','swf'),
|
||||
'text' => array('txt'),
|
||||
'archive' => array('tar','bz2','gz','cab','dmg','rar','sea','sit','sqx','zip'),
|
||||
'code' => array('css','html','php','js'),
|
||||
'code' => array('css','html','php','js'),
|
||||
));
|
||||
foreach ( $ext2type as $type => $exts )
|
||||
if ( in_array($ext, $exts) )
|
||||
|
||||
@@ -937,8 +937,8 @@ function the_editor($content, $id = 'content', $prev_id = 'title', $media_button
|
||||
<a id="edButtonHTML" class="active"><?php _e('HTML'); ?></a>
|
||||
<a id="edButtonPreview" onclick="switchEditors.go('<?php echo $id; ?>');"><?php _e('Visual'); ?></a>
|
||||
<?php }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ( $media_buttons ) { ?>
|
||||
<div id="media-buttons">
|
||||
<?php do_action( 'media_buttons' ); ?>
|
||||
|
||||
@@ -132,7 +132,7 @@ var autosave = function() {
|
||||
|
||||
/* Gotta do this up here so we can check the length when tinyMCE is in use */
|
||||
if ( rich ) { tinyMCE.triggerSave(); }
|
||||
|
||||
|
||||
post_data["content"] = jQuery("#content").val();
|
||||
if ( jQuery('#post_name').val() )
|
||||
post_data["post_name"] = jQuery('#post_name').val();
|
||||
|
||||
@@ -25,15 +25,15 @@ function zeroise(number, threshold) {
|
||||
}
|
||||
|
||||
var now = new Date();
|
||||
var datetime = now.getUTCFullYear() + '-' +
|
||||
var datetime = now.getUTCFullYear() + '-' +
|
||||
zeroise(now.getUTCMonth() + 1, 2) + '-' +
|
||||
zeroise(now.getUTCDate(), 2) + 'T' +
|
||||
zeroise(now.getUTCHours(), 2) + ':' +
|
||||
zeroise(now.getUTCMinutes(), 2) + ':' +
|
||||
zeroise(now.getUTCDate(), 2) + 'T' +
|
||||
zeroise(now.getUTCHours(), 2) + ':' +
|
||||
zeroise(now.getUTCMinutes(), 2) + ':' +
|
||||
zeroise(now.getUTCSeconds() ,2) +
|
||||
'+00:00';
|
||||
|
||||
edButtons[edButtons.length] =
|
||||
edButtons[edButtons.length] =
|
||||
new edButton('ed_strong'
|
||||
,'b'
|
||||
,'<strong>'
|
||||
@@ -41,7 +41,7 @@ new edButton('ed_strong'
|
||||
,'b'
|
||||
);
|
||||
|
||||
edButtons[edButtons.length] =
|
||||
edButtons[edButtons.length] =
|
||||
new edButton('ed_em'
|
||||
,'i'
|
||||
,'<em>'
|
||||
@@ -49,7 +49,7 @@ new edButton('ed_em'
|
||||
,'i'
|
||||
);
|
||||
|
||||
edButtons[edButtons.length] =
|
||||
edButtons[edButtons.length] =
|
||||
new edButton('ed_link'
|
||||
,'link'
|
||||
,''
|
||||
@@ -57,7 +57,7 @@ new edButton('ed_link'
|
||||
,'a'
|
||||
); // special case
|
||||
|
||||
edButtons[edButtons.length] =
|
||||
edButtons[edButtons.length] =
|
||||
new edButton('ed_block'
|
||||
,'b-quote'
|
||||
,'\n\n<blockquote>'
|
||||
@@ -66,7 +66,7 @@ new edButton('ed_block'
|
||||
);
|
||||
|
||||
|
||||
edButtons[edButtons.length] =
|
||||
edButtons[edButtons.length] =
|
||||
new edButton('ed_del'
|
||||
,'del'
|
||||
,'<del datetime="' + datetime + '">'
|
||||
@@ -74,7 +74,7 @@ new edButton('ed_del'
|
||||
,'d'
|
||||
);
|
||||
|
||||
edButtons[edButtons.length] =
|
||||
edButtons[edButtons.length] =
|
||||
new edButton('ed_ins'
|
||||
,'ins'
|
||||
,'<ins datetime="' + datetime + '">'
|
||||
@@ -82,7 +82,7 @@ new edButton('ed_ins'
|
||||
,'s'
|
||||
);
|
||||
|
||||
edButtons[edButtons.length] =
|
||||
edButtons[edButtons.length] =
|
||||
new edButton('ed_img'
|
||||
,'img'
|
||||
,''
|
||||
@@ -91,7 +91,7 @@ new edButton('ed_img'
|
||||
,-1
|
||||
); // special case
|
||||
|
||||
edButtons[edButtons.length] =
|
||||
edButtons[edButtons.length] =
|
||||
new edButton('ed_ul'
|
||||
,'ul'
|
||||
,'<ul>\n'
|
||||
@@ -99,7 +99,7 @@ new edButton('ed_ul'
|
||||
,'u'
|
||||
);
|
||||
|
||||
edButtons[edButtons.length] =
|
||||
edButtons[edButtons.length] =
|
||||
new edButton('ed_ol'
|
||||
,'ol'
|
||||
,'<ol>\n'
|
||||
@@ -107,7 +107,7 @@ new edButton('ed_ol'
|
||||
,'o'
|
||||
);
|
||||
|
||||
edButtons[edButtons.length] =
|
||||
edButtons[edButtons.length] =
|
||||
new edButton('ed_li'
|
||||
,'li'
|
||||
,'\t<li>'
|
||||
@@ -115,7 +115,7 @@ new edButton('ed_li'
|
||||
,'l'
|
||||
);
|
||||
|
||||
edButtons[edButtons.length] =
|
||||
edButtons[edButtons.length] =
|
||||
new edButton('ed_code'
|
||||
,'code'
|
||||
,'<code>'
|
||||
@@ -123,7 +123,7 @@ new edButton('ed_code'
|
||||
,'c'
|
||||
);
|
||||
|
||||
edButtons[edButtons.length] =
|
||||
edButtons[edButtons.length] =
|
||||
new edButton('ed_more'
|
||||
,'more'
|
||||
,'<!--more-->'
|
||||
@@ -132,7 +132,7 @@ new edButton('ed_more'
|
||||
,-1
|
||||
);
|
||||
/*
|
||||
edButtons[edButtons.length] =
|
||||
edButtons[edButtons.length] =
|
||||
new edButton('ed_next'
|
||||
,'page'
|
||||
,'<!--nextpage-->'
|
||||
@@ -220,7 +220,7 @@ function edQuickLink(i, thisSelect) {
|
||||
if (edLinks[i].newWin == 1) {
|
||||
newWin = ' target="_blank"';
|
||||
}
|
||||
var tempStr = '<a href="' + edLinks[i].URL + '"' + newWin + '>'
|
||||
var tempStr = '<a href="' + edLinks[i].URL + '"' + newWin + '>'
|
||||
+ edLinks[i].display
|
||||
+ '</a>';
|
||||
thisSelect.selectedIndex = 0;
|
||||
@@ -298,21 +298,21 @@ function edInsertTag(myField, i) {
|
||||
if (startPos != endPos) {
|
||||
myField.value = myField.value.substring(0, startPos)
|
||||
+ edButtons[i].tagStart
|
||||
+ myField.value.substring(startPos, endPos)
|
||||
+ myField.value.substring(startPos, endPos)
|
||||
+ edButtons[i].tagEnd
|
||||
+ myField.value.substring(endPos, myField.value.length);
|
||||
cursorPos += edButtons[i].tagStart.length + edButtons[i].tagEnd.length;
|
||||
}
|
||||
else {
|
||||
if (!edCheckOpenTags(i) || edButtons[i].tagEnd == '') {
|
||||
myField.value = myField.value.substring(0, startPos)
|
||||
myField.value = myField.value.substring(0, startPos)
|
||||
+ edButtons[i].tagStart
|
||||
+ myField.value.substring(endPos, myField.value.length);
|
||||
edAddTag(i);
|
||||
cursorPos = startPos + edButtons[i].tagStart.length;
|
||||
}
|
||||
else {
|
||||
myField.value = myField.value.substring(0, startPos)
|
||||
myField.value = myField.value.substring(0, startPos)
|
||||
+ edButtons[i].tagEnd
|
||||
+ myField.value.substring(endPos, myField.value.length);
|
||||
edRemoveTag(i);
|
||||
@@ -350,7 +350,7 @@ function edInsertContent(myField, myValue) {
|
||||
var startPos = myField.selectionStart;
|
||||
var endPos = myField.selectionEnd;
|
||||
myField.value = myField.value.substring(0, startPos)
|
||||
+ myValue
|
||||
+ myValue
|
||||
+ myField.value.substring(endPos, myField.value.length);
|
||||
myField.focus();
|
||||
myField.selectionStart = startPos + myValue.length;
|
||||
@@ -380,9 +380,9 @@ function edInsertLink(myField, i, defaultValue) {
|
||||
function edInsertImage(myField) {
|
||||
var myValue = prompt(quicktagsL10n.enterImageURL, 'http://');
|
||||
if (myValue) {
|
||||
myValue = '<img src="'
|
||||
+ myValue
|
||||
+ '" alt="' + prompt(quicktagsL10n.enterImageDescription, '')
|
||||
myValue = '<img src="'
|
||||
+ myValue
|
||||
+ '" alt="' + prompt(quicktagsL10n.enterImageDescription, '')
|
||||
+ '" />';
|
||||
edInsertContent(myField, myValue);
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ var wpList = {
|
||||
s.element = cls[2] || e.attr( 'id' ) || s.element || null;
|
||||
if ( cls[3] ) { s.addColor = '#' + cls[3]; }
|
||||
else { s.addColor = s.addColor || '#FFFF33'; }
|
||||
|
||||
|
||||
if ( !s ) { return false; }
|
||||
|
||||
if ( !e.is("[class^=add:" + list.id + ":]") ) { return !wpList.add.call( list, e, s ); }
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
// scale down the default size of an image so it's a better fit for the editor and theme
|
||||
function image_constrain_size_for_editor($width, $height, $size = 'medium') {
|
||||
|
||||
|
||||
if ( $size == 'thumb' ) {
|
||||
$max_width = intval(get_option('thumbnail_size_w'));
|
||||
$max_height = intval(get_option('thumbnail_size_h'));
|
||||
@@ -33,7 +33,7 @@ function image_constrain_size_for_editor($width, $height, $size = 'medium') {
|
||||
}
|
||||
|
||||
list( $max_width, $max_height ) = apply_filters( 'editor_max_image_size', array( $max_width, $max_height ), $size );
|
||||
|
||||
|
||||
return wp_constrain_dimensions( $width, $height, $max_width, $max_height );
|
||||
}
|
||||
|
||||
@@ -51,15 +51,15 @@ function image_hwstring($width, $height) {
|
||||
// The URL might be the original image, or it might be a resized version.
|
||||
// returns an array($url, $width, $height)
|
||||
function image_downsize($id, $size = 'medium') {
|
||||
|
||||
|
||||
$img_url = wp_get_attachment_url($id);
|
||||
$meta = wp_get_attachment_metadata($id);
|
||||
$width = $height = 0;
|
||||
|
||||
|
||||
// plugins can use this to provide resize services
|
||||
if ( $out = apply_filters('image_downsize', false, $id, $size) )
|
||||
return $out;
|
||||
|
||||
|
||||
if ( $size == 'thumb' ) {
|
||||
// thumbnail: use the thumb as the displayed image, and constrain based on its dimensions
|
||||
$thumb_path = wp_get_attachment_thumb_file($id);
|
||||
@@ -74,9 +74,9 @@ function image_downsize($id, $size = 'medium') {
|
||||
// any other type: use the real image and constrain it
|
||||
list( $width, $height ) = image_constrain_size_for_editor( $meta['width'], $meta['height'], $size );
|
||||
}
|
||||
|
||||
|
||||
return array( $img_url, $width, $height );
|
||||
|
||||
|
||||
}
|
||||
|
||||
// return an <img src /> tag for the given image attachment, scaling it down if requested
|
||||
@@ -97,31 +97,31 @@ function get_image_tag($id, $alt, $title, $align, $rel = false, $size='medium')
|
||||
function wp_constrain_dimensions( $current_width, $current_height, $max_width=0, $max_height=0 ) {
|
||||
if ( !$max_width and !$max_height )
|
||||
return array( $current_width, $current_height );
|
||||
|
||||
|
||||
$width_ratio = $height_ratio = 1.0;
|
||||
|
||||
|
||||
if ( $max_width > 0 && $current_width > $max_width )
|
||||
$width_ratio = $max_width / $current_width;
|
||||
|
||||
|
||||
if ( $max_height > 0 && $current_height > $max_height )
|
||||
$height_ratio = $max_height / $current_height;
|
||||
|
||||
|
||||
// the smaller ratio is the one we need to fit it to the constraining box
|
||||
$ratio = min( $width_ratio, $height_ratio );
|
||||
|
||||
|
||||
return array( intval($current_width * $ratio), intval($current_height * $ratio) );
|
||||
}
|
||||
|
||||
// calculate dimensions and coordinates for a resized image that fits within a specified width and height
|
||||
// if $crop is true, the largest matching central portion of the image will be cropped out and resized to the required size
|
||||
function image_resize_dimensions($orig_w, $orig_h, $dest_w, $dest_h, $crop=false) {
|
||||
|
||||
|
||||
if ($orig_w <= 0 || $orig_h <= 0)
|
||||
return false;
|
||||
// at least one of dest_w or dest_h must be specific
|
||||
if ($dest_w <= 0 && $dest_h <= 0)
|
||||
return false;
|
||||
|
||||
|
||||
if ( $crop ) {
|
||||
// crop the largest possible portion of the original image that we can size to $dest_w x $dest_h
|
||||
$aspect_ratio = $orig_w / $orig_h;
|
||||
@@ -135,7 +135,7 @@ function image_resize_dimensions($orig_w, $orig_h, $dest_w, $dest_h, $crop=false
|
||||
}
|
||||
|
||||
$size_ratio = max($new_w / $orig_w, $new_h / $orig_h);
|
||||
|
||||
|
||||
$crop_w = ceil($new_w / $size_ratio);
|
||||
$crop_h = ceil($new_h / $size_ratio);
|
||||
|
||||
@@ -146,13 +146,13 @@ function image_resize_dimensions($orig_w, $orig_h, $dest_w, $dest_h, $crop=false
|
||||
// don't crop, just resize using $dest_w x $dest_h as a maximum bounding box
|
||||
$crop_w = $orig_w;
|
||||
$crop_h = $orig_h;
|
||||
|
||||
|
||||
$s_x = 0;
|
||||
$s_y = 0;
|
||||
|
||||
|
||||
list( $new_w, $new_h ) = wp_constrain_dimensions( $orig_w, $orig_h, $dest_w, $dest_h );
|
||||
}
|
||||
|
||||
|
||||
// if the resulting image would be the same size or larger we don't want to resize it
|
||||
if ($new_w >= $orig_w && $new_h >= $orig_h)
|
||||
return false;
|
||||
@@ -175,7 +175,7 @@ function image_resize( $file, $max_w, $max_h, $crop=false, $suffix=null, $dest_p
|
||||
if (!$dims)
|
||||
return $dims;
|
||||
list($dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h) = $dims;
|
||||
|
||||
|
||||
$newimage = imagecreatetruecolor( $dst_w, $dst_h);
|
||||
|
||||
// preserve PNG transparency
|
||||
|
||||
@@ -650,7 +650,7 @@ function check_ajax_referer( $action = -1, $query_arg = false ) {
|
||||
else
|
||||
$nonce = $_REQUEST['_ajax_nonce'] ? $_REQUEST['_ajax_nonce'] : $_REQUEST['_wpnonce'];
|
||||
|
||||
if ( !wp_verify_nonce( $nonce, $action ) )
|
||||
if ( !wp_verify_nonce( $nonce, $action ) )
|
||||
die('-1');
|
||||
|
||||
do_action('check_ajax_referer');
|
||||
@@ -856,7 +856,7 @@ function wp_notify_moderator($comment_id) {
|
||||
$comment_author_domain = @gethostbyaddr($comment->comment_author_IP);
|
||||
$comments_waiting = $wpdb->get_var("SELECT count(comment_ID) FROM $wpdb->comments WHERE comment_approved = '0'");
|
||||
|
||||
switch ($comment->comment_type)
|
||||
switch ($comment->comment_type)
|
||||
{
|
||||
case 'trackback':
|
||||
$notify_message = sprintf( __('A new trackback on the post #%1$s "%2$s" is waiting for your approval'), $post->ID, $post->post_title ) . "\r\n";
|
||||
@@ -882,11 +882,11 @@ function wp_notify_moderator($comment_id) {
|
||||
$notify_message .= __('Comment: ') . "\r\n" . $comment->comment_content . "\r\n\r\n";
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
$notify_message .= sprintf( __('Approve it: %s'), get_option('siteurl')."/wp-admin/comment.php?action=mac&c=$comment_id" ) . "\r\n";
|
||||
$notify_message .= sprintf( __('Delete it: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&c=$comment_id" ) . "\r\n";
|
||||
$notify_message .= sprintf( __('Spam it: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&dt=spam&c=$comment_id" ) . "\r\n";
|
||||
|
||||
|
||||
$strCommentsPending = sprintf( __ngettext('%s comment', '%s comments', $comments_waiting), $comments_waiting );
|
||||
$notify_message .= sprintf( __('Currently %s are waiting for approval. Please visit the moderation panel:'), $strCommentsPending ) . "\r\n";
|
||||
$notify_message .= get_option('siteurl') . "/wp-admin/moderation.php\r\n";
|
||||
|
||||
@@ -1428,8 +1428,8 @@ function wp_publish_post($post_id) {
|
||||
/**
|
||||
* check_and_publish_future_post() - check to make sure post has correct status before
|
||||
* passing it on to be published. Invoked by cron 'publish_future_post' event
|
||||
* This safeguard prevents cron from publishing drafts, etc.
|
||||
*
|
||||
* This safeguard prevents cron from publishing drafts, etc.
|
||||
*
|
||||
* {@internal Missing Long Description}}
|
||||
*
|
||||
* @package WordPress
|
||||
@@ -1441,7 +1441,7 @@ function wp_publish_post($post_id) {
|
||||
* @return int|null {@internal Missing Description}}
|
||||
*/
|
||||
function check_and_publish_future_post($post_id) {
|
||||
|
||||
|
||||
$post = get_post($post_id);
|
||||
|
||||
if ( empty($post) )
|
||||
@@ -1450,7 +1450,7 @@ function check_and_publish_future_post($post_id) {
|
||||
if ( 'future' != $post->post_status )
|
||||
return;
|
||||
|
||||
return wp_publish_post($post_id);
|
||||
return wp_publish_post($post_id);
|
||||
}
|
||||
|
||||
function wp_add_post_tags($post_id = 0, $tags = '') {
|
||||
@@ -2931,7 +2931,7 @@ function _get_post_ancestors(&$_post) {
|
||||
|
||||
if ( !empty($_post->ancestors) )
|
||||
return;
|
||||
|
||||
|
||||
$_post->ancestors = array();
|
||||
|
||||
if ( empty($_post->post_parent) || $_post->ID == $_post->post_parent )
|
||||
|
||||
@@ -32,13 +32,13 @@ class WP_Scripts {
|
||||
// Let a plugin replace the visual editor
|
||||
$visual_editor = apply_filters('visual_editor', array('tiny_mce'));
|
||||
$this->add( 'editor', false, $visual_editor, '20080218' );
|
||||
|
||||
|
||||
$this->add( 'editor_functions', '/wp-admin/js/editor.js', false, '20080221' );
|
||||
|
||||
|
||||
// Modify this version when tinyMCE plugins are changed.
|
||||
$mce_version = apply_filters('tiny_mce_version', '20080226');
|
||||
$this->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_config.php', array('editor_functions'), $mce_version );
|
||||
|
||||
|
||||
$this->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.6');
|
||||
|
||||
$this->add( 'wp-ajax-response', '/wp-includes/js/wp-ajax-response.js', array('jquery'), '20080229' . mt_rand() );
|
||||
@@ -479,12 +479,12 @@ function wp_prototype_before_jquery( $js_array ) {
|
||||
return $js_array;
|
||||
}
|
||||
|
||||
// These localizations require information that may not be loaded even by init
|
||||
function wp_just_in_time_script_localization() {
|
||||
wp_localize_script( 'tiny_mce', 'wpTinyMCEConfig', array( 'defaultEditor' => wp_default_editor() ) );
|
||||
// These localizations require information that may not be loaded even by init
|
||||
function wp_just_in_time_script_localization() {
|
||||
wp_localize_script( 'tiny_mce', 'wpTinyMCEConfig', array( 'defaultEditor' => wp_default_editor() ) );
|
||||
}
|
||||
|
||||
add_filter( 'wp_print_scripts', 'wp_just_in_time_script_localization' );
|
||||
add_filter( 'wp_print_scripts', 'wp_just_in_time_script_localization' );
|
||||
add_filter( 'print_scripts_array', 'wp_prototype_before_jquery' );
|
||||
|
||||
?>
|
||||
|
||||
@@ -262,7 +262,7 @@ function is_active_widget($callback, $widget_id = false) {
|
||||
if ( isset($wp_registered_widgets[$widget]['callback']) && $wp_registered_widgets[$widget]['callback'] == $callback )
|
||||
if ( !$widget_id || $widget_id == $wp_registered_widgets[$widget]['id'] )
|
||||
return $sidebar;
|
||||
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user