Title: PHP Error
Last modified: September 1, 2016

---

# PHP Error

 *  Resolved [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/)
 * (@aurovrata)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/php-error-196/)
 * The plugin needs to be updated for WP 4.5. The following error is being thrown,
 * >  PHP Fatal error: Call to undefined function get_currentuserinfo() in /Users/
   > aurovrata/Sites/hrm/wp-content/plugins/attendance-manager/class/class-attmgr.
   > php on line 239
 * because the function `get_currentuserinfo()` has been [deprecated](https://codex.wordpress.org/Function_Reference/get_currentuserinfo)
   in WP 4.5.
 * [https://wordpress.org/plugins/attendance-manager/](https://wordpress.org/plugins/attendance-manager/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [tnomi](https://wordpress.org/support/users/tnomi/)
 * (@tnomi)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/php-error-196/#post-7560447)
 * Thank you for your feedback.
    Please try to change like the following code for
   now. /attendance-manager/class/class-attmgr.php on line 239
 * Before:
 *     ```
       public function current_user() {
       	// Current operator
       	get_currentuserinfo();
       	...
       ```
   
 * After:
 *     ```
       public function current_user() {
       	global $current_user;
       	// Current operator
       	if( function_exists( 'wp_get_current_user' ) ){
       		$current_user = wp_get_current_user();
       	}
       	else{
       		get_currentuserinfo();
       	}
       	...
       ```
   
 * And I would like to correct it in the next version.
 *  Thread Starter [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/)
 * (@aurovrata)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/php-error-196/#post-7560454)
 * Thank you, I have corrected it in the code. When will you update the next version?
 *  Plugin Author [tnomi](https://wordpress.org/support/users/tnomi/)
 * (@tnomi)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/php-error-196/#post-7560465)
 * I will update it sometime this week or next week.
 *  Thread Starter [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/)
 * (@aurovrata)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/php-error-196/#post-7560469)
 * Actually, the call to the function `wp_get_current_user` needs to be done after
   the plugin is loaded (on the `init` action or later).
 * So I have removed the constructor call to the `load()` function (line 61) as 
   it is being called by the `plugins_loaded` action (line 68). It now works well.
 *  Plugin Author [tnomi](https://wordpress.org/support/users/tnomi/)
 * (@tnomi)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/php-error-196/#post-7560531)
 * Thank you for advice.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘PHP Error’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/attendance-manager.svg)
 * [Attendance Manager](https://wordpress.org/plugins/attendance-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/attendance-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/attendance-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/attendance-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/attendance-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/attendance-manager/reviews/)

## Tags

 * [php-error](https://wordpress.org/support/topic-tag/php-error/)

 * 5 replies
 * 2 participants
 * Last reply from: [tnomi](https://wordpress.org/support/users/tnomi/)
 * Last activity: [9 years, 11 months ago](https://wordpress.org/support/topic/php-error-196/#post-7560531)
 * Status: resolved