Title: Deprecated PHP Function
Last modified: August 22, 2018

---

# Deprecated PHP Function

 *  [Lee Hodson (VR51)](https://wordpress.org/support/users/leehodson/)
 * (@leehodson)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/deprecated-php-function-3/)
 * The function create_function() is deprecated in PHP 7.2. Please change line 34
   of pubexchange_widget.php
 * **From**
 *     ```
       if($this->settings->pubexchange_publication_id){
       		//register PubExchange widget
       		add_action('widgets_init', create_function('', 'return register_widget("WP_Widget_PubExchange");'));
       }
       ```
   
 * **To**
 *     ```
       if($this->settings->pubexchange_publication_id){
       		//register PubExchange widget
       		add_action('widgets_init', function() {register_widget("WP_Widget_PubExchange");});
       }
       ```
   
    -  This topic was modified 7 years, 9 months ago by [Lee Hodson (VR51)](https://wordpress.org/support/users/leehodson/).

The topic ‘Deprecated PHP Function’ is closed to new replies.

 * ![](https://ps.w.org/pubexchange/assets/icon-128x128.png?rev=1170955)
 * [PubExchange](https://wordpress.org/plugins/pubexchange/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pubexchange/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pubexchange/)
 * [Active Topics](https://wordpress.org/support/plugin/pubexchange/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pubexchange/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pubexchange/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Lee Hodson (VR51)](https://wordpress.org/support/users/leehodson/)
 * Last activity: [7 years, 9 months ago](https://wordpress.org/support/topic/deprecated-php-function-3/)
 * Status: not resolved