I Got Fatal error: Call to undefined function get_currentuserinfo()

I tried using a) get_userdata( $userid );
b) $current_user = wp_get_current_user();
c) $current_user = get_currentuserinfo();
in wp_includes/post.php

I need to update a table whenever a post is published in admin portion and I tried to retreive above details but it throws error.

Read more here: I tried to list user and post information from (wp_includes/post.php ) but it throws error


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: