Changeset 1347

Show
Ignore:
Timestamp:
07/03/08 17:00:59 (2 months ago)
Author:
donncha
Message:

WP Merge to rev 8249

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-admin/admin-header.php

    r1344 r1347  
    7171<div id="wpcontent"> 
    7272<div id="wphead"> 
    73 <h1><?php if ( '' == get_bloginfo('name') ) echo '&nbsp;'; 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 '&nbsp;'; else echo get_bloginfo('name', 'display'); ?><span id="viewsite"><a href="<?php echo trailingslashit( get_option('home') ); ?>"><?php _e('Visit Site') ?></a></span></h1> 
    7474</div> 
    7575 
  • trunk/wp-admin/gears-manifest.php

    r1344 r1347  
    6565{ 
    6666"betaManifestVersion" : 1, 
    67 "version" : "<?php echo $man_version; ?>_20080626", 
     67"version" : "<?php echo $man_version; ?>_20080703", 
    6868"entries" : [ 
    6969<?php echo $defaults; ?> 
     
    192192{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/img/image.png" }, 
    193193{ "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" } 
    195199]} 
  • trunk/wp-admin/includes/media.php

    r1344 r1347  
    6262        return $html; 
    6363} 
     64 
     65function 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} 
     82add_filter( 'image_send_to_editor', 'image_add_caption', 20, 7 ); 
    6483 
    6584function media_send_to_editor($html) { 
     
    213232        $out = <<<EOF 
    214233 
    215         <a href="{$image_upload_iframe_src}&amp;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}&amp;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}&amp;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}&amp;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}&amp;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}&amp;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}&amp;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}&amp;TB_iframe=true" id="add_media" class="thickbox" title='$media_title'><img src='images/media-button-other.gif' alt='$media_title' /></a> 
    219238 
    220239EOF; 
     
    322341                $src = $id; 
    323342 
    324                 unset($file_array); 
    325  
    326343                if ( is_wp_error($id) ) { 
    327                         $errors['upload_error'] = $id
     344                        @unlink($file_array['tmp_name'])
    328345                        return $id; 
    329346                } 
  • trunk/wp-admin/includes/misc.php

    r1242 r1347  
    6969                } 
    7070                if (!$foundit) { 
    71                         fwrite( $f, "# BEGIN {$marker}\n" ); 
     71                        fwrite( $f, "\n# BEGIN {$marker}\n" ); 
    7272                        foreach ( $insertion as $insertline ) 
    7373                                fwrite( $f, "{$insertline}\n" ); 
  • trunk/wp-admin/includes/post.php

    r1328 r1347  
    9494                $mn = $_POST['mn']; 
    9595                $ss = $_POST['ss']; 
     96                $aa = ($aa <= 0 ) ? date('Y') : $aa; 
     97                $mm = ($mm <= 0 ) ? date('n') : $mm; 
    9698                $jj = ($jj > 31 ) ? 31 : $jj; 
     99                $jj = ($jj <= 0 ) ? date('j') : $jj; 
    97100                $hh = ($hh > 23 ) ? $hh -24 : $hh; 
    98101                $mn = ($mn > 59 ) ? $mn -60 : $mn; 
  • trunk/wp-admin/includes/template.php

    r1336 r1347  
    768768        $actions = array(); 
    769769 
     770        if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 
    770771                $actions['approve']   = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a> | '; 
    771772                $actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a> | '; 
     
    780781                } 
    781782 
    782         if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 
    783783                $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> | '; 
    784784                $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 ); 
    785786                foreach ( $actions as $action => $link ) 
    786787                        echo "<span class='$action'>$link</span>"; 
  • trunk/wp-admin/js/editor.js

    r1260 r1347  
    5353        content = content.replace(new RegExp('\\s*<div', 'mg'), '\n<div'); 
    5454        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'); 
    5556 
    5657        var blocklist2 = 'blockquote|ul|ol|li|table|thead|tr|th|td|h[1-6]|pre'; 
     
    7071        // Trim whitespace 
    7172        content = content.replace(new RegExp('^\\s*', ''), ''); 
    72         content = content.replace(new RegExp('\\s*$', ''), ''); 
     73        content = content.replace(new RegExp('[\\s\\u00a0]*$', ''), ''); 
    7374 
    7475        // put back the line breaks in pre|script 
     
    165166        pee = pee.replace(new RegExp('(</?(?:'+blocklist+')[^>]*>)\\s*<br />', 'gi'), "$1"); 
    166167        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]'); 
    167169        // pee = pee.replace(new RegExp('^((?:&nbsp;)*)\\s', 'mg'), '$1&nbsp;'); 
    168170 
  • trunk/wp-admin/js/media-upload.js

    r1342 r1347  
    66                        ed.selection.moveToBookmark(tinymce.EditorManager.activeEditor.windowManager.bookmark); 
    77 
     8                if ( h.indexOf('[wp_caption') != -1 ) 
     9                        h = ed.plugins.wpeditimage._do_shcode(h); 
     10                 
    811                ed.execCommand('mceInsertContent', false, h); 
    912        } else 
  • trunk/wp-admin/plugins.php

    r1336 r1347  
    1010 
    1111$action = ''; 
    12 foreach( array('activate-selected', 'deactivate-selected', 'delete-selected') as $action_key ) { 
     12foreach( array('activate-selected', 'deactivate-selected', 'delete-selected', 'clear-recent-list') as $action_key ) { 
    1313        if( isset($_POST[$action_key]) ) { 
    1414                $action = $action_key; 
     
    157157                                require_once('admin-footer.php'); 
    158158                                exit; 
    159                         } 
    160                         //$delete_result = delete_plugins($plugins); 
     159                        } //Endif verify-delete 
     160                        $delete_result = delete_plugins($plugins); 
    161161 
    162162                        wp_cache_delete('plugins', 'plugins'); 
    163  
     163                        break; 
     164                case 'clear-recent-list': 
     165                        update_option('recently_activated', array()); 
    164166                        break; 
    165167        } 
     
    205207<?php 
    206208 
     209$all_plugins = apply_filters( 'all_plugins', get_plugins() ); 
    207210$active_plugins = array(); 
    208 $available_plugins = array(); 
     211$inactive_plugins = array(); 
    209212$recent_plugins = array(); 
    210213$recently_activated = (array)get_option('recently_activated'); 
     
    216219if( $recently_activated != get_option('recently_activated') ) //If array changed, update it. 
    217220        update_option('recently_activated', $recently_activated); 
    218  
    219 $all_plugins = apply_filters( 'all_plugins', get_plugins() ); 
    220221 
    221222$plugins_allowedtags = array('a' => array('href' => array(),'title' => array()),'abbr' => array('title' => array()),'acronym' => array('title' => array()),'code' => array(),'em' => array(),'strong' => array()); 
     
    231232                $plugin_data['Description'] .= ' <cite>' . sprintf( __('By %s'), $plugin_data['Author'] ) . '.</cite>'; 
    232233 
     234        //Filter into individual sections 
    233235        if ( is_plugin_active($plugin_file) ) { 
    234236                $active_plugins[ $plugin_file ] = $plugin_data; 
     
    237239                        $recent_plugins[ $plugin_file ] = $plugin_data; 
    238240                else 
    239                         $available_plugins[ $plugin_file ] = $plugin_data; 
     241                        $inactive_plugins[ $plugin_file ] = $plugin_data; 
    240242        } 
    241243} 
     
    297299?> 
    298300 
     301<?php if ( ! empty($active_plugins) ) : ?> 
    299302<h3 id="currently-active"><?php _e('Currently Active Plugins') ?></h3> 
    300303<form method="post" action="<?php echo admin_url('plugins.php') ?>"> 
     
    311314 
    312315<p><?php printf(__('If something goes wrong with a plugin and you can&#8217;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; ?> 
    313317 
    314318<?php if ( ! empty($recent_plugins) ) : ?> 
    315319<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> 
    316321<form method="post" action="<?php echo admin_url('plugins.php') ?>"> 
    317322<?php wp_nonce_field('bulk-manage-plugins') ?> 
     
    327332<?php endif; ?> 
    328333 
    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> 
    330336<form method="post" action="<?php echo admin_url('plugins.php') ?>"> 
    331337<?php wp_nonce_field('bulk-manage-plugins') ?> 
    332338 
    333 <?php if ( ! empty($available_plugins) ) : ?> 
    334339<div class="tablenav"> 
    335340        <div class="alignleft"> 
     
    338343</div> 
    339344<br class="clear" /> 
    340 <?php print_plugins_table($available_plugins, 'available') ?> 
     345<?php print_plugins_table($inactive_plugins, 'inactive') ?> 
    341346</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> 
    342351<?php endif; ?> 
    343352<?php if( is_site_admin() ) { ?> 
  • trunk/wp-admin/press-this.php

    r1344 r1347  
    116116 
    117117// Ajax Requests 
    118 $title = wp_specialchars(stripslashes($_GET['t'])); 
     118$title = wp_specialchars(aposfix(stripslashes($_GET['t']))); 
    119119 
    120120$selection = str_replace("\n", "<br />", aposfix( stripslashes($_GET['s']) ) ); 
     
    137137        </div> 
    138138                 
    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> 
    141141         
    142142        <p id="options"><a href="#" class="select"><?php _e('Insert Image'); ?></a> | <a href="#" class="cancel"><?php _e('Cancel'); ?></a></p> 
     
    172172        <h2 id="embededcode"><label for="embed_code"><?php _e('Embed Code') ?></label></h2> 
    173173        <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> 
    175175        </div> 
    176176<?php die; 
     
    179179if($_REQUEST['ajax'] == 'photo_images') { 
    180180        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'))  
    182182                        return "'".$uri."'"; 
    183183 
     
    187187                $host = parse_url($uri); 
    188188                 
    189                 $pattern = '/<img ([^>]*)src=(\"|\')(.+?)(\2)([^>\/]*)\/*>/is'; 
     189                $pattern = '/<img ([^>]*)src=(\"|\')([^<>]+?\.(png|jpeg|jpg|jpe|gif))(\2)([^>\/]*)\/*>/is'; 
    190190                preg_match_all($pattern, $content, $matches); 
    191191                 
     
    200200                                        $src = 'http://'.str_replace('//','/', $host['host'].'/'.$host['path'].'/'.$src); 
    201201                                                                                 
    202                         $sources[] = $src
     202                        $sources[] = clean_url($src)
    203203                } 
    204204                return "'" . implode("','", $sources) . "'"; 
     
    401401                                set_menu('quote'); 
    402402                                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>"); 
    404404                                return false; 
    405405                                break; 
     
    421421                                        $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 . '&amp;server=www.vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" />      <embed src="http://www.vimeo.com/moogaloop.swf?clip_id=' . $video_id . '&amp;server=www.vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="225"></embed></object>'; 
    422422                                         
    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 { 
    425426                                                $content = $selection; 
    426427                                        } ?> 
     
    434435                                set_menu('photo'); 
    435436                                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); ?>"); 
    438439                                <?php } ?> 
    439440                                jQuery('#extra_fields').show(); 
     
    500501                        <h2 id="content_type"><label for="content"><?php _e('Post') ?></label></h2> 
    501502                        <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> 
    503504                        </div> 
    504505                </div> 
  • trunk/wp-admin/setup-config.php

    r1328 r1347  
    22die(); 
    33define('WP_INSTALLING', true); 
    4 //These two defines are required to allow us to use require_wp_db() to load the database class while being wp-content/wp-db.php aware 
     4//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 
    55define('ABSPATH', dirname(dirname(__FILE__)).'/'); 
    66define('WPINC', 'wp-includes'); 
     7define('WP_CONTENT_DIR', ABSPATH . 'wp-content'); 
    78 
    89require_once('../wp-includes/compat.php'); 
  • trunk/wp-app.php

    r1344 r1347  
    198198                // check to see if AtomPub is enabled 
    199199                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') ) ); 
    201201 
    202202                // dispatch 
  • trunk/wp-content/themes/classic/style.css

    r1218 r1347  
    320320        text-transform: capitalize; 
    321321} 
     322 
     323/* Captions & aligment */ 
     324.aligncenter, 
     325dl.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  
    639639 
    640640 
     641/* Captions */ 
     642.aligncenter, 
     643dl.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 
    641676/* "Daisy, Daisy, give me your answer do. I'm half crazy all for the love of you. 
    642677        It won't be a stylish marriage, I can't afford a carriage. 
  • trunk/wp-includes/feed.php

    r1218 r1347  
    11<?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 */ 
    328function get_bloginfo_rss($show = '') { 
    429        $info = strip_tags(get_bloginfo($show)); 
     
    631} 
    732 
     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 */ 
    848function bloginfo_rss($show = '') { 
    949        echo apply_filters('bloginfo_rss', get_bloginfo_rss($show), $show); 
    1050} 
    1151 
     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 */ 
    1265function get_default_feed() { 
    1366        return apply_filters('default_feed', 'rss2'); 
    1467} 
    1568 
     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 */ 
    1681function get_wp_title_rss($sep = '&#187;') { 
    1782        $title = wp_title($sep, false); 
     
    2287} 
    2388 
     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 */ 
    24100function wp_title_rss($sep = '&#187;') { 
    25101        echo apply_filters('wp_title_rss', get_wp_title_rss($sep)); 
    26102} 
    27103 
     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 */ 
    28114function get_the_title_rss() { 
    29115        $title = get_the_title(); 
     
    32118} 
    33119 
    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 */ 
    35128function the_title_rss() { 
    36129        echo get_the_title_rss(); 
    37130} 
    38131 
    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 */ 
    40162function the_content_rss($more_link_text='(more...)', $stripteaser=0, $more_file='', $cut = 0, $encode_html = 0) { 
    41163        $content = get_the_content($more_link_text, $stripteaser, $more_file); 
     
    60182                        $use_dotdotdot = 0; 
    61183                } 
     184 
     185                /** @todo Check performance, might be faster to use array slice instead. */ 
    62186                for ( $i=0; $i<$k; $i++ ) 
    63187                        $excerpt .= $blah[$i].' '; 
     
    69193} 
    70194 
    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 */ 
    72203function the_excerpt_rss() { 
    73204        $output = get_the_excerpt(); 
     
    75206} 
    76207 
     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 */ 
    77216function the_permalink_rss() { 
    78217        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 */ 
    82227function comment_guid() { 
    83228        echo get_comment_guid(); 
    84229} 
    85230 
     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 */ 
    86240function get_comment_guid() { 
    87241        global $comment; 
     
    93247} 
    94248 
     249/** 
     250 * Display the link to the comments. 
     251 * 
     252 * @since 1.5.0 
     253 */ 
    95254function comment_link() { 
    96255        echo get_comment_link(); 
    97256} 
    98257 
     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 */ 
    99269function get_comment_author_rss() { 
    100270        return apply_filters('comment_author_rss', get_comment_author() ); 
    101271} 
    102272 
     273/** 
     274 * Display the current comment author in the feed. 
     275 * 
     276 * @package WordPress 
     277 * @subpackage Feed 
     278 * @since 1.0.0 
     279 */ 
    103280function comment_author_rss() { 
    104281        echo get_comment_author_rss(); 
    105282} 
    106283 
     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 */ 
    107293function comment_text_rss() { 
    108294        $comment_text = get_comment_text(); 
     
    111297} 
    112298 
     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 */ 
    113314function get_the_category_rss($type = 'rss') { 
    114315        $categories = get_the_category(); 
     
    143344} 
    144345 
     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 */ 
    145356function the_category_rss($type = 'rss') { 
    146357        echo get_the_category_rss($type); 
    147358} 
    148359 
     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 */ 
    149369function html_type_rss() { 
    150370        $type = get_bloginfo('html_type'); 
     
    156376} 
    157377 
    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 */ 
    159396function rss_enclosure() { 
    160397        global $post; 
     
    172409} 
    173410 
     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 */ 
    174428function atom_enclosure() { 
    175429        global $post; 
     
    188442 
    189443/** 
    190  * prep_atom_text_construct() - Determine the type of a given string of data 
     444 * Determine the type of a string of data with the data formatted. 
    191445 * 
    192446 * Tell whether the type is text, html, or xhtml, per RFC 4287 section 3.1. 
     
    203457 * @since 2.5 
    204458 * 
    205  * @param string $data input string 
    206  * @return array $result array(type, value) 
     459 * @param string $data Input string 
     460 * @return array array(type, value) 
    207461 */ 
    208462function prep_atom_text_construct($data) { 
     
    233487 
    234488/** 
    235  * self_link() - Generate a correct link for the atom:self elemet 
    236  * 
    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
    238492 * 
    239493 * @package WordPress 
    240494 * @subpackage Feed 
    241495 * @since 2.5 
    242  * 
    243496 */ 
    244497function self_link() { 
  • trunk/wp-includes/functions.php

    r1344 r1347  
    516516        $newvalue = sanitize_option( $option_name, $newvalue ); 
    517517 
     518        $oldvalue = get_option( $safe_option_name ); 
     519 
     520        $newvalue = apply_filters( 'pre_update_option_' . $option_name, $newvalue, $oldvalue ); 
     521 
    518522        // If the new and old values are the same, no need to update. 
    519         $oldvalue = get_option( $safe_option_name ); 
    520523        if ( $newvalue === $oldvalue ) 
    521524                return false; 
  • trunk/wp-includes/js/tinymce/langs/wp-langs.php