Title: Parse error: syntax error, unexpected T_FUNCTION
Last modified: August 21, 2016

---

# Parse error: syntax error, unexpected T_FUNCTION

 *  Resolved [dogshindleg](https://wordpress.org/support/users/dogshindleg/)
 * (@dogshindleg)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_function-10/)
 * Getting an error (Parse error: syntax error, unexpected T_FUNCTION) when I add
   custom conditions.
 * Here is my code:
 *     ```
       add_filter( 'if_menu_conditions', 'my_new_menu_conditions' );
   
       	function my_new_menu_conditions( $conditions ) {
       		$conditions[] = array(
       			'name' => 'If has current subscription', // name of the condition
       			'condition' => function() { // callback - must return TRUE or FALSE
       				return current_user_can('has_current_subscription');
       			}
       		);
       		return $conditions;
       	}
       ```
   
 * Help!
 * [http://wordpress.org/plugins/if-menu/](http://wordpress.org/plugins/if-menu/)

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

 *  Thread Starter [dogshindleg](https://wordpress.org/support/users/dogshindleg/)
 * (@dogshindleg)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_function-10/#post-4550739)
 * It seems to be a php 5.4 related problem.
 * If I enable php 5.4 via my .htaccess file (as per [this](https://support.hostgator.com/articles/hosting-guide/hardware-software/php-5-4))
   I am able to use my custom condition function, however I get the following error.
 * Strict Standards: Declaration of If_Menu_Walker_Nav_Menu_Edit::start_el() should
   be compatible with Walker_Nav_Menu_Edit::start_el(&$output, $item, $depth = 0,
   $args = Array, $id = 0) in /wp-content/plugins/if-menu/if-menu.php on line 151
 *  Thread Starter [dogshindleg](https://wordpress.org/support/users/dogshindleg/)
 * (@dogshindleg)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_function-10/#post-4550740)
 * Also this error on the front end
 * Warning: Cannot modify header information – headers already sent by (output started
   at /wp-content/plugins/if-menu/if-menu.php:151) in /wp-content/plugins/woocommerce/
   classes/class-wc-session-handler.php on line 63
 *  Plugin Author [Andrei](https://wordpress.org/support/users/andreiigna/)
 * (@andreiigna)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_function-10/#post-4551028)
 * Hi,
 * The plugin was updated to work with latest versions of WordPress.
 * Please update if you are still using it.

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

The topic ‘Parse error: syntax error, unexpected T_FUNCTION’ is closed to new replies.

 * ![](https://ps.w.org/if-menu/assets/icon-256x256.png?rev=1862232)
 * [If Menu - Visibility control for Menus](https://wordpress.org/plugins/if-menu/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/if-menu/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/if-menu/)
 * [Active Topics](https://wordpress.org/support/plugin/if-menu/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/if-menu/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/if-menu/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Andrei](https://wordpress.org/support/users/andreiigna/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_function-10/#post-4551028)
 * Status: resolved