Changeset 1347
- Timestamp:
- 07/03/08 17:00:59 (2 months ago)
- Files:
-
- trunk/wp-admin/admin-header.php (modified) (1 diff)
- trunk/wp-admin/gears-manifest.php (modified) (2 diffs)
- trunk/wp-admin/includes/media.php (modified) (3 diffs)
- trunk/wp-admin/includes/misc.php (modified) (1 diff)
- trunk/wp-admin/includes/post.php (modified) (1 diff)
- trunk/wp-admin/includes/template.php (modified) (2 diffs)
- trunk/wp-admin/js/editor.js (modified) (3 diffs)
- trunk/wp-admin/js/media-upload.js (modified) (1 diff)
- trunk/wp-admin/plugins.php (modified) (10 diffs)
- trunk/wp-admin/press-this.php (modified) (10 diffs)
- trunk/wp-admin/setup-config.php (modified) (1 diff)
- trunk/wp-app.php (modified) (1 diff)
- trunk/wp-content/themes/classic/style.css (modified) (1 diff)
- trunk/wp-content/themes/default/style.css (modified) (1 diff)
- trunk/wp-includes/feed.php (modified) (15 diffs)
- trunk/wp-includes/functions.php (modified) (1 diff)
- trunk/wp-includes/js/tinymce/langs/wp-langs.php (modified) (1 diff)
- trunk/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js (modified) (1 diff)
- trunk/wp-includes/js/tinymce/plugins/wordpress/img/audio.gif (added)
- trunk/wp-includes/js/tinymce/plugins/wordpress/img/image.gif (added)
- trunk/wp-includes/js/tinymce/plugins/wordpress/img/media.gif (added)
- trunk/wp-includes/js/tinymce/plugins/wordpress/img/video.gif (added)
- trunk/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js (modified) (5 diffs)
- trunk/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js (modified) (15 diffs)
- trunk/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css (modified) (2 diffs)
- trunk/wp-includes/js/tinymce/tiny_mce_config.php (modified) (1 diff)
- trunk/wp-includes/js/tinymce/wordpress.css (modified) (3 diffs)
- trunk/wp-includes/media.php (modified) (1 diff)
- trunk/wp-includes/script-loader.php (modified) (3 diffs)
- trunk/wp-includes/taxonomy.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-admin/admin-header.php
r1344 r1347 71 71 <div id="wpcontent"> 72 72 <div id="wphead"> 73 <h1><?php if ( '' == get_bloginfo('name' ) ) echo ' '; else echo get_bloginfo('name'); ?><span id="viewsite"><a href="<?php echo trailingslashit( get_option('home') ); ?>"><?php _e('Visit Site') ?></a></span></h1>73 <h1><?php if ( '' == get_bloginfo('name', 'display') ) echo ' '; else echo get_bloginfo('name', 'display'); ?><span id="viewsite"><a href="<?php echo trailingslashit( get_option('home') ); ?>"><?php _e('Visit Site') ?></a></span></h1> 74 74 </div> 75 75 trunk/wp-admin/gears-manifest.php
r1344 r1347 65 65 { 66 66 "betaManifestVersion" : 1, 67 "version" : "<?php echo $man_version; ?>_20080 626",67 "version" : "<?php echo $man_version; ?>_20080703", 68 68 "entries" : [ 69 69 <?php echo $defaults; ?> … … 192 192 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/img/image.png" }, 193 193 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/img/delete.png" }, 194 { "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/help.gif" } 194 { "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/help.gif" }, 195 { "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/image.gif" }, 196 { "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/media.gif" }, 197 { "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/video.gif" }, 198 { "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/audio.gif" } 195 199 ]} trunk/wp-admin/includes/media.php
r1344 r1347 62 62 return $html; 63 63 } 64 65 function image_add_caption( $html, $id, $alt, $title, $align, $url, $size ) { 66 67 if ( empty($alt) ) return $html; 68 $id = ( 0 < (int) $id ) ? 'attachment_' . $id : ''; 69 70 preg_match( '/width="([0-9]+)/', $html, $matches ); 71 if ( ! isset($matches[1]) ) return $html; 72 $width = $matches[1]; 73 74 $html = preg_replace( '/align[^\s\'"]+\s?/', '', $html ); 75 if ( empty($align) ) $align = 'none'; 76 77 $shcode = '[wp_caption id="' . $id . '" align="align' . $align 78 . '" width="' . $width . '" caption="' . $alt . '"]' . $html . '[/wp_caption]'; 79 80 return apply_filters( 'image_add_caption_shortcode', $shcode, $html ); 81 } 82 add_filter( 'image_send_to_editor', 'image_add_caption', 20, 7 ); 64 83 65 84 function media_send_to_editor($html) { … … 213 232 $out = <<<EOF 214 233 215 <a href="{$image_upload_iframe_src}&TB_iframe=true" class="thickbox" title='$image_title'><img src='images/media-button-image.gif' alt='$image_title' /></a>216 <a href="{$video_upload_iframe_src}&TB_iframe=true" class="thickbox" title='$video_title'><img src='images/media-button-video.gif' alt='$video_title' /></a>217 <a href="{$audio_upload_iframe_src}&TB_iframe=true" class="thickbox" title='$audio_title'><img src='images/media-button-music.gif' alt='$audio_title' /></a>218 <a href="{$media_upload_iframe_src}&TB_iframe=true" class="thickbox" title='$media_title'><img src='images/media-button-other.gif' alt='$media_title' /></a>234 <a href="{$image_upload_iframe_src}&TB_iframe=true" id="add_image" class="thickbox" title='$image_title'><img src='images/media-button-image.gif' alt='$image_title' /></a> 235 <a href="{$video_upload_iframe_src}&TB_iframe=true" id="add_video" class="thickbox" title='$video_title'><img src='images/media-button-video.gif' alt='$video_title' /></a> 236 <a href="{$audio_upload_iframe_src}&TB_iframe=true" id="add_audio" class="thickbox" title='$audio_title'><img src='images/media-button-music.gif' alt='$audio_title' /></a> 237 <a href="{$media_upload_iframe_src}&TB_iframe=true" id="add_media" class="thickbox" title='$media_title'><img src='images/media-button-other.gif' alt='$media_title' /></a> 219 238 220 239 EOF; … … 322 341 $src = $id; 323 342 324 unset($file_array);325 326 343 if ( is_wp_error($id) ) { 327 $errors['upload_error'] = $id;344 @unlink($file_array['tmp_name']); 328 345 return $id; 329 346 } trunk/wp-admin/includes/misc.php
r1242 r1347 69 69 } 70 70 if (!$foundit) { 71 fwrite( $f, " # BEGIN {$marker}\n" );71 fwrite( $f, "\n# BEGIN {$marker}\n" ); 72 72 foreach ( $insertion as $insertline ) 73 73 fwrite( $f, "{$insertline}\n" ); trunk/wp-admin/includes/post.php
r1328 r1347 94 94 $mn = $_POST['mn']; 95 95 $ss = $_POST['ss']; 96 $aa = ($aa <= 0 ) ? date('Y') : $aa; 97 $mm = ($mm <= 0 ) ? date('n') : $mm; 96 98 $jj = ($jj > 31 ) ? 31 : $jj; 99 $jj = ($jj <= 0 ) ? date('j') : $jj; 97 100 $hh = ($hh > 23 ) ? $hh -24 : $hh; 98 101 $mn = ($mn > 59 ) ? $mn -60 : $mn; trunk/wp-admin/includes/template.php
r1336 r1347 768 768 $actions = array(); 769 769 770 if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 770 771 $actions['approve'] = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a> | '; 771 772 $actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a> | '; … … 780 781 } 781 782 782 if ( current_user_can('edit_post', $comment->comment_post_ID) ) {783 783 $actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1' title='" . __( 'Mark this comment as spam' ) . "'>" . __( 'Spam' ) . '</a> | '; 784 784 $actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID delete'>" . __('Delete') . '</a>'; 785 $actions = apply_filters( 'comment_row_actions', $actions, $comment ); 785 786 foreach ( $actions as $action => $link ) 786 787 echo "<span class='$action'>$link</span>"; trunk/wp-admin/js/editor.js
r1260 r1347 53 53 content = content.replace(new RegExp('\\s*<div', 'mg'), '\n<div'); 54 54 content = content.replace(new RegExp('</div>\\s*', 'mg'), '</div>\n'); 55 content = content.replace(new RegExp('\\s*\\[wp_caption([^\\[]+)\\[/wp_caption\\]\\s*', 'gi'), '\n\n[wp_caption$1[/wp_caption]\n\n'); 55 56 56 57 var blocklist2 = 'blockquote|ul|ol|li|table|thead|tr|th|td|h[1-6]|pre'; … … 70 71 // Trim whitespace 71 72 content = content.replace(new RegExp('^\\s*', ''), ''); 72 content = content.replace(new RegExp(' \\s*$', ''), '');73 content = content.replace(new RegExp('[\\s\\u00a0]*$', ''), ''); 73 74 74 75 // put back the line breaks in pre|script … … 165 166 pee = pee.replace(new RegExp('(</?(?:'+blocklist+')[^>]*>)\\s*<br />', 'gi'), "$1"); 166 167 pee = pee.replace(new RegExp('<br />(\\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)', 'gi'), '$1'); 168 pee = pee.replace(new RegExp('(?:<p>|<br ?/?>)*\\s*\\[wp_caption([^\\[]+)\\[/wp_caption\\]\\s*(?:</p>|<br ?/?>)*', 'gi'), '[wp_caption$1[/wp_caption]'); 167 169 // pee = pee.replace(new RegExp('^((?: )*)\\s', 'mg'), '$1 '); 168 170 trunk/wp-admin/js/media-upload.js
r1342 r1347 6 6 ed.selection.moveToBookmark(tinymce.EditorManager.activeEditor.windowManager.bookmark); 7 7 8 if ( h.indexOf('[wp_caption') != -1 ) 9 h = ed.plugins.wpeditimage._do_shcode(h); 10 8 11 ed.execCommand('mceInsertContent', false, h); 9 12 } else trunk/wp-admin/plugins.php
r1336 r1347 10 10 11 11 $action = ''; 12 foreach( array('activate-selected', 'deactivate-selected', 'delete-selected' ) as $action_key ) {12 foreach( array('activate-selected', 'deactivate-selected', 'delete-selected', 'clear-recent-list') as $action_key ) { 13 13 if( isset($_POST[$action_key]) ) { 14 14 $action = $action_key; … … 157 157 require_once('admin-footer.php'); 158 158 exit; 159 } 160 //$delete_result = delete_plugins($plugins);159 } //Endif verify-delete 160 $delete_result = delete_plugins($plugins); 161 161 162 162 wp_cache_delete('plugins', 'plugins'); 163 163 break; 164 case 'clear-recent-list': 165 update_option('recently_activated', array()); 164 166 break; 165 167 } … … 205 207 <?php 206 208 209 $all_plugins = apply_filters( 'all_plugins', get_plugins() ); 207 210 $active_plugins = array(); 208 $ available_plugins = array();211 $inactive_plugins = array(); 209 212 $recent_plugins = array(); 210 213 $recently_activated = (array)get_option('recently_activated'); … … 216 219 if( $recently_activated != get_option('recently_activated') ) //If array changed, update it. 217 220 update_option('recently_activated', $recently_activated); 218 219 $all_plugins = apply_filters( 'all_plugins', get_plugins() );220 221 221 222 $plugins_allowedtags = array('a' => array('href' => array(),'title' => array()),'abbr' => array('title' => array()),'acronym' => array('title' => array()),'code' => array(),'em' => array(),'strong' => array()); … … 231 232 $plugin_data['Description'] .= ' <cite>' . sprintf( __('By %s'), $plugin_data['Author'] ) . '.</cite>'; 232 233 234 //Filter into individual sections 233 235 if ( is_plugin_active($plugin_file) ) { 234 236 $active_plugins[ $plugin_file ] = $plugin_data; … … 237 239 $recent_plugins[ $plugin_file ] = $plugin_data; 238 240 else 239 $ available_plugins[ $plugin_file ] = $plugin_data;241 $inactive_plugins[ $plugin_file ] = $plugin_data; 240 242 } 241 243 } … … 297 299 ?> 298 300 301 <?php if ( ! empty($active_plugins) ) : ?> 299 302 <h3 id="currently-active"><?php _e('Currently Active Plugins') ?></h3> 300 303 <form method="post" action="<?php echo admin_url('plugins.php') ?>"> … … 311 314 312 315 <p><?php printf(__('If something goes wrong with a plugin and you can’t use WordPress, delete or rename that file in the <code>%s</code> directory and it will be automatically deactivated.'), WP_PLUGIN_DIR); ?></p> 316 <?php endif; ?> 313 317 314 318 <?php if ( ! empty($recent_plugins) ) : ?> 315 319 <h3 id="recent-plugins"><?php _e('Recently Active Plugins') ?></h3> 320 <p><?php _e('The following plugins were recently active. When a plugin has been inactive for more than 7 days it will be moved to the Inactive plugin list.') ?></p> 316 321 <form method="post" action="<?php echo admin_url('plugins.php') ?>"> 317 322 <?php wp_nonce_field('bulk-manage-plugins') ?> … … 327 332 <?php endif; ?> 328 333 329 <h3 id="available-plugins"><?php _e('Available Plugins') ?></h3> 334 <?php if ( ! empty($inactive_plugins) ) : ?> 335 <h3 id="inactive-plugins"><?php _e('Inactive Plugins') ?></h3> 330 336 <form method="post" action="<?php echo admin_url('plugins.php') ?>"> 331 337 <?php wp_nonce_field('bulk-manage-plugins') ?> 332 338 333 <?php if ( ! empty($available_plugins) ) : ?>334 339 <div class="tablenav"> 335 340 <div class="alignleft"> … … 338 343 </div> 339 344 <br class="clear" /> 340 <?php print_plugins_table($ available_plugins, 'available') ?>345 <?php print_plugins_table($inactive_plugins, 'inactive') ?> 341 346 </form> 347 <?php endif; ?> 348 349 <?php if ( empty($all_plugins) ) : ?> 350 <p><?php _e('You do not appear to have any plugins available at this time.') ?></p> 342 351 <?php endif; ?> 343 352 <?php if( is_site_admin() ) { ?> trunk/wp-admin/press-this.php
r1344 r1347 116 116 117 117 // Ajax Requests 118 $title = wp_specialchars( stripslashes($_GET['t']));118 $title = wp_specialchars(aposfix(stripslashes($_GET['t']))); 119 119 120 120 $selection = str_replace("\n", "<br />", aposfix( stripslashes($_GET['s']) ) ); … … 137 137 </div> 138 138 139 <p><input type="hidden" name="this_photo" value="<?php echo $image; ?>" id="this_photo" />140 <a href="#" class="select"><img src="<?php echo $image; ?>" width="475" alt="<?php echo attribute_escape(__('Click to insert.')); ?>" title="<?php echo attribute_escape(__('Click to insert.')); ?>" /></a></p>139 <p><input type="hidden" name="this_photo" value="<?php echo attribute_escape($image); ?>" id="this_photo" /> 140 <a href="#" class="select"><img src="<?php echo clean_url($image); ?>" width="475" alt="<?php echo attribute_escape(__('Click to insert.')); ?>" title="<?php echo attribute_escape(__('Click to insert.')); ?>" /></a></p> 141 141 142 142 <p id="options"><a href="#" class="select"><?php _e('Insert Image'); ?></a> | <a href="#" class="cancel"><?php _e('Cancel'); ?></a></p> … … 172 172 <h2 id="embededcode"><label for="embed_code"><?php _e('Embed Code') ?></label></h2> 173 173 <div class="titlewrap" > 174 <textarea name="embed_code" id="embed_code" rows="8" cols="40"><?php echo $selection; ?></textarea>174 <textarea name="embed_code" id="embed_code" rows="8" cols="40"><?php echo format_to_edit($selection); ?></textarea> 175 175 </div> 176 176 <?php die; … … 179 179 if($_REQUEST['ajax'] == 'photo_images') { 180 180 function get_images_from_uri($uri) { 181 if(preg_match('/\.(jpg| png|gif)/', $uri) && !strpos($uri,'blogger.com'))181 if(preg_match('/\.(jpg|jpe|jpeg|png|gif)/', $uri) && !strpos($uri,'blogger.com')) 182 182 return "'".$uri."'"; 183 183 … … 187 187 $host = parse_url($uri); 188 188 189 $pattern = '/<img ([^>]*)src=(\"|\')( .+?)(\2)([^>\/]*)\/*>/is';189 $pattern = '/<img ([^>]*)src=(\"|\')([^<>]+?\.(png|jpeg|jpg|jpe|gif))(\2)([^>\/]*)\/*>/is'; 190 190 preg_match_all($pattern, $content, $matches); 191 191 … … 200 200 $src = 'http://'.str_replace('//','/', $host['host'].'/'.$host['path'].'/'.$src); 201 201 202 $sources[] = $src;202 $sources[] = clean_url($src); 203 203 } 204 204 return "'" . implode("','", $sources) . "'"; … … 401 401 set_menu('quote'); 402 402 set_title('<?php _e('Quote') ?>'); 403 set_editor("<blockquote><p><?php echo $selection; ?> </p><p><cite><a href='<?php echo $url; ?>'><?php echo $title; ?> </a> </cite> </p></blockquote>");403 set_editor("<blockquote><p><?php echo format_to_edit($selection); ?> </p><p><cite><a href='<?php echo $url; ?>'><?php echo $title; ?> </a> </cite> </p></blockquote>"); 404 404 return false; 405 405 break; … … 421 421 $content = '<object width="400" height="225"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://www.vimeo.com/moogaloop.swf?clip_id=' . $video_id . '&server=www.vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" /> <embed src="http://www.vimeo.com/moogaloop.swf?clip_id=' . $video_id . '&server=www.vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="225"></embed></object>'; 422 422 423 if(trim($selection) == '') $selection = '<a href="http://www.vimeo.com/' . $video_id . '?pg=embed&sec=' . $video_id . '">' . $title . '</a> on <a href="http://vimeo.com?pg=embed&sec=' . $video_id . '">Vimeo</a>'; 424 }else { 423 if ( trim($selection) == '' ) 424 $selection = '<a href="http://www.vimeo.com/' . $video_id . '?pg=embed&sec=' . $video_id . '">' . $title . '</a> on <a href="http://vimeo.com?pg=embed&sec=' . $video_id . '">Vimeo</a>'; 425 } else { 425 426 $content = $selection; 426 427 } ?> … … 434 435 set_menu('photo'); 435 436 set_title('<?php _e('Post') ?>'); 436 <?php if ($selection) { ?>437 set_editor("<?php echo $selection; ?>");437 <?php if ($selection) { ?> 438 set_editor("<?php echo format_to_edit($selection); ?>"); 438 439 <?php } ?> 439 440 jQuery('#extra_fields').show(); … … 500 501 <h2 id="content_type"><label for="content"><?php _e('Post') ?></label></h2> 501 502 <div class="editor-container"> 502 <textarea name="content" id="content" style="width:100%;" class="mceEditor"><?php if ($selection) { ?><a href='<?php echo $url ?>'><?php echo $selection?></a><?php } else { ?><a href='<?php echo $url ?>'><?php echo $title; ?></a><?php } ?></textarea>503 <textarea name="content" id="content" style="width:100%;" class="mceEditor"><?php if ($selection) { ?><a href='<?php echo $url ?>'><?php echo format_to_edit($selection) ?></a><?php } else { ?><a href='<?php echo $url ?>'><?php echo $title; ?></a><?php } ?></textarea> 503 504 </div> 504 505 </div> trunk/wp-admin/setup-config.php
r1328 r1347 2 2 die(); 3 3 define('WP_INSTALLING', true); 4 //These t wodefines are required to allow us to use require_wp_db() to load the database class while being wp-content/wp-db.php aware4 //These three defines are required to allow us to use require_wp_db() to load the database class while being wp-content/wp-db.php aware 5 5 define('ABSPATH', dirname(dirname(__FILE__)).'/'); 6 6 define('WPINC', 'wp-includes'); 7 define('WP_CONTENT_DIR', ABSPATH . 'wp-content'); 7 8 8 9 require_once('../wp-includes/compat.php'); trunk/wp-app.php
r1344 r1347 198 198 // check to see if AtomPub is enabled 199 199 if( !get_option( 'enable_app' ) ) 200 $this->not_allowed( 'AtomPub services are disabled on this blog. An admin user can enable them at ' . admin_url('options-writing.php') );200 $this->not_allowed( sprintf( __( 'AtomPub services are disabled on this blog. An admin user can enable them at %s' ), admin_url('options-writing.php') ) ); 201 201 202 202 // dispatch trunk/wp-content/themes/classic/style.css
r1218 r1347 320 320 text-transform: capitalize; 321 321 } 322 323 /* Captions & aligment */ 324 .aligncenter, 325 dl.aligncenter { 326 display: block; 327 margin-left: auto; 328 margin-right: auto; 329 } 330 331 .alignleft { 332 float: left; 333 } 334 335 .alignright { 336 float: right; 337 } 338 339 .wp_caption { 340 border: 1px solid #ddd; 341 text-align: center; 342 background-color: #f3f3f3; 343 padding-top: 4px; 344 margin: 10px; 345 -moz-border-radius: 3px; 346 -khtml-border-radius: 3px; 347 -webkit-border-radius: 3px; 348 border-radius: 3px; 349 } 350 351 .wp_caption img { 352 margin: 0; 353 padding: 0; 354 border: 0 none; 355 } 356 357 .wp_caption_dd { 358 font-size: 11px; 359 line-height: 17px; 360 padding: 0 4px 5px; 361 margin: 0; 362 } 363 /* End captions & aligment */ trunk/wp-content/themes/default/style.css
r1328 r1347 639 639 640 640 641 /* Captions */ 642 .aligncenter, 643 dl.aligncenter { 644 display: block; 645 margin-left: auto; 646 margin-right: auto; 647 } 648 649 .wp_caption { 650 border: 1px solid #ddd; 651 text-align: center; 652 background-color: #f3f3f3; 653 padding-top: 4px; 654 margin: 10px; 655 -moz-border-radius: 3px; 656 -khtml-border-radius: 3px; 657 -webkit-border-radius: 3px; 658 border-radius: 3px; 659 } 660 661 .wp_caption img { 662 margin: 0; 663 padding: 0; 664 border: 0 none; 665 } 666 667 .wp_caption_dd { 668 font-size: 11px; 669 line-height: 17px; 670 padding: 0 4px 5px; 671 margin: 0; 672 } 673 /* End captions */ 674 675 641 676 /* "Daisy, Daisy, give me your answer do. I'm half crazy all for the love of you. 642 677 It won't be a stylish marriage, I can't afford a carriage. trunk/wp-includes/feed.php
r1218 r1347 1 1 <?php 2 2 /** 3 * WordPress Feed API 4 * 5 * Many of the functions used in here belong in The Loop, or The Loop for the 6 * Feeds. 7 * 8 * @package WordPress 9 * @subpackage Feed 10 */ 11 12 /** 13 * RSS container for the bloginfo function. 14 * 15 * You can retrieve anything that you can using the get_bloginfo() function. 16 * Everything will be stripped of tags and characters converted, when the values 17 * are retrieved for use in the feeds. 18 * 19 * @package WordPress 20 * @subpackage Feed 21 * @since 1.5.1 22 * @uses apply_filters() Calls 'get_bloginfo_rss' hook with two parameters. 23 * @see get_bloginfo() For the list of possible values to display. 24 * 25 * @param string $show See get_bloginfo() for possible values. 26 * @return string 27 */ 3 28 function get_bloginfo_rss($show = '') { 4 29 $info = strip_tags(get_bloginfo($show)); … … 6 31 } 7 32 33 /** 34 * Display RSS container for the bloginfo function. 35 * 36 * You can retrieve anything that you can using the get_bloginfo() function. 37 * Everything will be stripped of tags and characters converted, when the values 38 * are retrieved for use in the feeds. 39 * 40 * @package WordPress 41 * @subpackage Feed 42 * @since 0.71 43 * @uses apply_filters() Calls 'bloginfo_rss' hook with two parameters. 44 * @see get_bloginfo() For the list of possible values to display. 45 * 46 * @param string $show See get_bloginfo() for possible values. 47 */ 8 48 function bloginfo_rss($show = '') { 9 49 echo apply_filters('bloginfo_rss', get_bloginfo_rss($show), $show); 10 50 } 11 51 52 /** 53 * Retrieve the default feed. 54 * 55 * The default feed is 'rss2', unless a plugin changes it through the 56 * 'default_feed' filter. 57 * 58 * @package WordPress 59 * @subpackage Feed 60 * @since 2.5 61 * @uses apply_filters() Calls 'default_feed' hook on the default feed string. 62 * 63 * @return string Default feed, or for example 'rss2', 'atom', etc. 64 */ 12 65 function get_default_feed() { 13 66 return apply_filters('default_feed', 'rss2'); 14 67 } 15 68 69 /** 70 * Retrieve the blog title for the feed title. 71 * 72 * @package WordPress 73 * @subpackage Feed 74 * @since 2.2.0 75 * @uses apply_filters() Calls 'get_wp_title_rss' hook on title. 76 * @uses wp_title() See function for $sep parameter usage. 77 * 78 * @param string $sep Optional.How to separate the title. See wp_title() for more info. 79 * @return string Error message on failure or blog title on success. 80 */ 16 81 function get_wp_title_rss($sep = '»') { 17 82 $title = wp_title($sep, false); … … 22 87 } 23 88 89 /** 90 * Display the blog title for display of the feed title. 91 * 92 * @package WordPress 93 * @subpackage Feed 94 * @since 2.2.0 95 * @uses apply_filters() Calls 'wp_title_rss' on the blog title. 96 * @see wp_title() $sep parameter usage. 97 * 98 * @param string $sep Optional. 99 */ 24 100 function wp_title_rss($sep = '»') { 25 101 echo apply_filters('wp_title_rss', get_wp_title_rss($sep)); 26 102 } 27 103 104 /** 105 * Retrieve the current post title for the feed. 106 * 107 * @package WordPress 108 * @subpackage Feed 109 * @since 2.0.0 110 * @uses apply_filters() Calls 'the_title_rss' on the post title. 111 * 112 * @return string Current post title. 113 */ 28 114 function get_the_title_rss() { 29 115 $title = get_the_title(); … … 32 118 } 33 119 34 120 /** 121 * Display the post title in the feed. 122 * 123 * @package WordPress 124 * @subpackage Feed 125 * @since 0.71 126 * @uses get_the_title_rss() Used to retrieve current post title. 127 */ 35 128 function the_title_rss() { 36 129 echo get_the_title_rss(); 37 130 } 38 131 39 132 /** 133 * Display the post content for the feed. 134 * 135 * For encoding the html or the $encode_html parameter, there are three possible 136 * values. '0' will make urls footnotes and use make_url_footnote(). '1' will 137 * encode special characters and automatically display all of the content. The 138 * value of '2' will strip all HTML tags from the content. 139 * 140 * Also note that you cannot set the amount of words and not set the html 141 * encoding. If that is the case, then the html encoding will default to 2, 142 * which will strip all HTML tags. 143 * 144 * To restrict the amount of words of the content, you can use the cut 145 * parameter. If the content is less than the amount, then there won't be any 146 * dots added to the end. If there is content left over, then dots will be added 147 * and the rest of the content will be removed. 148 * 149 * @package WordPress 150 * @subpackage Feed 151 * @since 0.71 152 * @uses apply_filters() Calls 'the_content_rss' on the content before processing. 153 * @see get_the_content() For the $more_link_text, $stripteaser, and $more_file 154 * parameters. 155 * 156 * @param string $more_link_text Optional. Text to display when more content is available but not displayed. 157 * @param int|bool $stripteaser Optional. Default is 0. 158 * @param string $more_file Optional. 159 * @param int $cut Optional. Amount of words to keep for the content. 160 * @param int $encode_html Optional. How to encode the content. 161 */ 40 162 function the_content_rss($more_link_text='(more...)', $stripteaser=0, $more_file='', $cut = 0, $encode_html = 0) { 41 163 $content = get_the_content($more_link_text, $stripteaser, $more_file); … … 60 182 $use_dotdotdot = 0; 61 183 } 184 185 /** @todo Check performance, might be faster to use array slice instead. */ 62 186 for ( $i=0; $i<$k; $i++ ) 63 187 $excerpt .= $blah[$i].' '; … … 69 193 } 70 194 71 195 /** 196 * Display the post excerpt for the feed. 197 * 198 * @package WordPress 199 * @subpackage Feed 200 * @since 0.71 201 * @uses apply_filters() Calls 'the_excerpt_rss' hook on the excerpt. 202 */ 72 203 function the_excerpt_rss() { 73 204 $output = get_the_excerpt(); … … 75 206 } 76 207 208 /** 209 * Display the permalink to the post for use in feeds. 210 * 211 * @package WordPress 212 * @subpackage Feed 213 * @since 2.3.0 214 * @uses apply_filters() Call 'the_permalink_rss' on the post permalink 215 */ 77 216 function the_permalink_rss() { 78 217 echo apply_filters('the_permalink_rss', get_permalink()); 79 80 } 81 218 } 219 220 /** 221 * Display the feed GUID for the current comment. 222 * 223 * @package WordPress 224 * @subpackage Feed 225 * @since unknown 226 */ 82 227 function comment_guid() { 83 228 echo get_comment_guid(); 84 229 } 85 230 231 /** 232 * Retrieve the feed GUID for the current comment. 233 * 234 * @package WordPress 235 * @subpackage Feed 236 * @since unknown 237 * 238 * @return bool|string false on failure or guid for comment on success. 239 */ 86 240 function get_comment_guid() { 87 241 global $comment; … … 93 247 } 94 248 249 /** 250 * Display the link to the comments. 251 * 252 * @since 1.5.0 253 */ 95 254 function comment_link() { 96 255 echo get_comment_link(); 97 256 } 98 257 258 /** 259 * Retrieve the current comment author for use in the feeds. 260 * 261 * @package WordPress 262 * @subpackage Feed 263 * @since 2.0.0 264 * @uses apply_filters() Calls 'comment_author_rss' hook on comment author. 265 * @uses get_comment_author() 266 * 267 * @return string Comment Author 268 */ 99 269 function get_comment_author_rss() { 100 270 return apply_filters('comment_author_rss', get_comment_author() ); 101 271 } 102 272 273 /** 274 * Display the current comment author in the feed. 275 * 276 * @package WordPress 277 * @subpackage Feed 278 * @since 1.0.0 279 */ 103 280 function comment_author_rss() { 104 281 echo get_comment_author_rss(); 105 282 } 106 283 284 /** 285 * Display the current comment content for use in the feeds. 286 * 287 * @package WordPress 288 * @subpackage Feed 289 * @since 1.0.0 290 * @uses apply_filters() Calls 'comment_text_rss' filter on comment content. 291 * @uses get_comment_text() 292 */ 107 293 function comment_text_rss() { 108 294 $comment_text = get_comment_text(); … … 111 297 } 112 298 299 /** 300 * Retrieve all of the post categories, formatted for use in feeds. 301 * 302 * All of the categories for the current post in the feed loop, will be 303 * retrieved and have feed markup added, so that they can easily be added to the 304 * RSS2, Atom, or RSS1 and RSS0.91 RDF feeds. 305 * 306 * @package WordPress 307 * @subpackage Feed 308 * @since 2.1.0 309 * @uses apply_filters() 310 * 311 * @param string $type Optional, default is 'rss'. Either 'rss', 'atom', or 'rdf'. 312 * @return string All of the post categories for displaying in the feed. 313 */ 113 314 function get_the_category_rss($type = 'rss') { 114 315 $categories = get_the_category(); … … 143 344 } 144 345 346 /** 347 * Display the post categories in the feed. 348 * 349 * @package WordPress 350 * @subpackage Feed 351 * @since 0.71 352 * @see get_the_category_rss() For better explanation. 353 * 354 * @param string $type Optional, default is 'rss'. Either 'rss', 'atom', or 'rdf'. 355 */ 145 356 function the_category_rss($type = 'rss') { 146 357 echo get_the_category_rss($type); 147 358 } 148 359 360 /** 361 * Display the HTML type based on the blog setting. 362 * 363 * The two possible values are either 'xhtml' or 'html'. 364 * 365 * @package WordPress 366 * @subpackage Feed 367 * @since 2.2.0 368 */ 149 369 function html_type_rss() { 150 370 $type = get_bloginfo('html_type'); … … 156 376 } 157 377 158 378 /** 379 * Display the rss enclosure for the current post. 380 * 381 * Uses the global $post to check whether the post requires a password and if 382 * the user has the password for the post. If not then it will return before 383 * displaying. 384 * 385 * Also uses the function get_post_custom() to get the post's 'enclosure' 386 * metadata field and parses the value to display the enclosure(s). The 387 * enclosure(s) consist of enclosure HTML tag(s) with a URI and other 388 * attributes. 389 * 390 * @package WordPress 391 * @subpackage Template 392 * @since 1.5.0 393 * @uses apply_filters() Calls 'rss_enclosure' hook on rss enclosure. 394 * @uses get_post_custom() To get the current post enclosure metadata. 395 */ 159 396 function rss_enclosure() { 160 397 global $post; … … 172 409 } 173 410 411 /** 412 * Display the atom enclosure for the current post. 413 * 414 * Uses the global $post to check whether the post requires a password and if 415 * the user has the password for the post. If not then it will return before 416 * displaying. 417 * 418 * Also uses the function get_post_custom() to get the post's 'enclosure' 419 * metadata field and parses the value to display the enclosure(s). The 420 * enclosure(s) consist of link HTML tag(s) with a URI and other attributes. 421 * 422 * @package WordPress 423 * @subpackage Template 424 * @since 2.2.0 425 * @uses apply_filters() Calls 'atom_enclosure' hook on atom enclosure. 426 * @uses get_post_custom() To get the current post enclosure metadata. 427 */ 174 428 function atom_enclosure() { 175 429 global $post; … … 188 442 189 443 /** 190 * prep_atom_text_construct() - Determine the type of a given string of data444 * Determine the type of a string of data with the data formatted. 191 445 * 192 446 * Tell whether the type is text, html, or xhtml, per RFC 4287 section 3.1. … … 203 457 * @since 2.5 204 458 * 205 * @param string $data input string206 * @return array $resultarray(type, value)459 * @param string $data Input string 460 * @return array array(type, value) 207 461 */ 208 462 function prep_atom_text_construct($data) { … … 233 487 234 488 /** 235 * self_link() - Generate a correct link for the atom:self elemet236 * 237 * Echo the link for the currently displayed feed in a XSS safe way.489 * Display the link for the currently displayed feed in a XSS safe way. 490 * 491 * Generate a correct link for the atom:self element. 238 492 * 239 493 * @package WordPress 240 494 * @subpackage Feed 241 495 * @since 2.5 242 *243 496 */ 244 497 function self_link() { trunk/wp-includes/functions.php
r1344 r1347 516 516 $newvalue = sanitize_option( $option_name, $newvalue ); 517 517 518 $oldvalue = get_option( $safe_option_name ); 519 520 $newvalue = apply_filters( 'pre_update_option_' . $option_name, $newvalue, $oldvalue ); 521 518 522 // If the new and old values are the same, no need to update. 519 $oldvalue = get_option( $safe_option_name );520 523 if ( $newvalue === $oldvalue ) 521 524 return false; trunk/wp-includes/js/tinymce/langs/wp-langs.php
