tags:

views:

20

answers:

1

Hi all ..

h r u?

In Wordpress , I want when the author of the post reading his post showing text like' Delete Post , Edit Post , .... etc" only for the author not for all ..

First: I want to know the id of user login Second: I want to know the id of author .. 3:

if($user_id_login == $id_author){
echo 'Delete Post , Edit Post ... etc';
}

but from where I give the $user_id_login and $id_author values ..

Please help me ^_^

+1  A: 

Something like this:

if ( is_user_logged_in() ){
    global $current_user;
    get_currentuserinfo();
    if( $current_user->ID == $post->post_author ){
        echo "<a href='#'>edit</a>";
    }
}

PS: Look at your accept rate! don't forget to accept answer or no one will ever answer you again.

silent
wow great .. it is right .. thank you very much ..
AboSami
there, you forgot to accept answer again
silent
oh , I'm sorry , I don't know about this before .. thank you very much .. I accept your answer ^_^ ..
AboSami