[wp-cvs] wordpress/wp-includes template-functions-links.php, 1.52, 1.53

Michel Valdrighi michelvaldrighi at users.sourceforge.net
Tue Feb 1 11:14:48 GMT 2005


Update of /cvsroot/cafelog/wordpress/wp-includes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv966/wp-includes

Modified Files:
	template-functions-links.php 
Log Message:
Fix for bug #559, just use user_can_ functions

Index: template-functions-links.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/template-functions-links.php,v
retrieving revision 1.52
retrieving revision 1.53
diff -C2 -d -r1.52 -r1.53
*** template-functions-links.php	1 Feb 2005 02:01:38 -0000	1.52
--- template-functions-links.php	1 Feb 2005 11:14:45 -0000	1.53
***************
*** 175,188 ****
  
  function edit_post_link($link = 'Edit This', $before = '', $after = '') {
!     global $user_level, $post;
  
      get_currentuserinfo();
  
!     if ($user_level > 0) {
!         $authordata = get_userdata($post->post_author);
!         if ($user_level < $authordata->user_level) {
!             return;
!         }
!     } else {
          return;
      }
--- 175,183 ----
  
  function edit_post_link($link = 'Edit This', $before = '', $after = '') {
!     global $user_ID, $post;
  
      get_currentuserinfo();
  
! 	if (!user_can_edit_post($user_ID, $post->ID)) {
          return;
      }
***************
*** 193,206 ****
  
  function edit_comment_link($link = 'Edit This', $before = '', $after = '') {
!     global $user_level, $post, $comment;
  
      get_currentuserinfo();
  
!     if ($user_level > 0) {
!         $authordata = get_userdata($post->post_author);
!         if ($user_level < $authordata->user_level) {
!             return;
!         }
!     } else {
          return;
      }
--- 188,196 ----
  
  function edit_comment_link($link = 'Edit This', $before = '', $after = '') {
!     global $user_ID, $post, $comment;
  
      get_currentuserinfo();
  
! 	if (!user_can_edit_post_comments($user_ID, $post->ID)) {
          return;
      }



More information about the cvs mailing list