Ticket #2055: 2055-postpassword.patch
| File 2055-postpassword.patch, 1.5 KB (added by , 18 years ago) |
|---|
-
wp-includes/link-template.php
271 271 return apply_filters('post_comments_feed_link', $url); 272 272 } 273 273 274 function get_clear_password_link(){ 275 $url = get_option('home') . "/?clear_password=yes"; 276 return apply_filters('clear_password_link',$url); 277 } 278 279 function clear_password_link($post,$tail){ 280 if ( !empty($post->post_password) ){ 281 if ( stripslashes($_COOKIE['wp-postpass_'.COOKIEHASH]) == $post->post_password ){ 282 $link = '<a href="'; 283 $link = $link . get_clear_password_link(); 284 $link = $link . '">Clear Post Password</a>'; 285 $link = $link . $tail; 286 echo $link; 287 } 288 } 289 } 290 274 291 function get_edit_post_link( $id = 0 ) { 275 292 $post = &get_post( $id ); 276 293 -
wp-includes/query.php
406 406 , 'paged' 407 407 , 'comments_popup' 408 408 , 'preview' 409 , 'clear_password' 409 410 ); 410 411 411 412 foreach ($keys as $key) { … … 718 719 $q['page'] = (int) $q['page']; 719 720 $q['page'] = abs($q['page']); 720 721 } 722 if (isset($q['clear_password'])){ 723 setcookie('wp-postpass_' . COOKIEHASH, ' ', time() - 31536000, COOKIEPATH); 724 } 721 725 722 726 $add_hours = intval(get_option('gmt_offset')); 723 727 $add_minutes = intval(60 * (get_option('gmt_offset') - $add_hours));