Title: Fix PHP action hook
Last modified: May 11, 2023

---

# Fix PHP action hook

 *  Resolved [Jules Colle](https://wordpress.org/support/users/jules-colle/)
 * (@jules-colle)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/fix-php-hook/)
 * Hi, could you guys please fix the action hook in class-pages-weglot.php at line
   79?
 * `add_action( 'admin_bar_menu', array( $this, 'add_admin_bar_menu' ), PHP_INT_MAX);`
 * By setting the priority to PHP_INT_MAX you are preventing developers to customise
   the weglot menu in the admin bar.

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

 *  Plugin Contributor [Edson Galina Fortes](https://wordpress.org/support/users/glx77/)
 * (@glx77)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/fix-php-hook/#post-16731989)
 * Hi [@jules-colle](https://wordpress.org/support/users/jules-colle/) ,
   hope you’re
   fine? Thanks for the feedback, I’ll modify the code and add a filter to let you
   modifiy the PHP_INT_MAXIt should be deploy on our next releaseRegards
 *  Thread Starter [Jules Colle](https://wordpress.org/support/users/jules-colle/)
 * (@jules-colle)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/fix-php-hook/#post-16732232)
 * Glad to hear you are willing to make the change!
 * I’m not sure that we understand each other 100%. The only thing I would like 
   is that you change PHP_INT_MAX to an arbitrary large number like 200. It will
   have the same effect and it will allow plugin/theme developers to see the weglot
   menu in the admin_bar_menu hook if they set their priority higher than 200.
 * Now it’s not possible because a plugin developer can’t set the priority higher
   than PHP_INT_MAX
 * So: no need to add an extra hook, just set the priority on your hook to something
   lower than infinite 🙂
 *  Plugin Contributor [Edson Galina Fortes](https://wordpress.org/support/users/glx77/)
 * (@glx77)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/fix-php-hook/#post-16742050)
 * Hi [@jules-colle](https://wordpress.org/support/users/jules-colle/) ,
   yes your
   right, we pan to push a new release next week and it will contain this fix. Thank
   you so much for your feedbacks it’s appreciateRegards
 *  Plugin Contributor [Edson Galina Fortes](https://wordpress.org/support/users/glx77/)
 * (@glx77)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/fix-php-hook/#post-16778917)
 * Hi [@jules-colle](https://wordpress.org/support/users/jules-colle/) ,
   hope you’re
   fine. We’ve just release a 4.0.2 version of the plugin with the update.Once again
   thank you for your feedback it’s help 😉Regards

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

The topic ‘Fix PHP action hook’ is closed to new replies.

 * ![](https://ps.w.org/weglot/assets/icon-256x256.gif?rev=3333666)
 * [Translate WordPress with Weglot - Multilingual AI Translation](https://wordpress.org/plugins/weglot/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/weglot/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/weglot/)
 * [Active Topics](https://wordpress.org/support/plugin/weglot/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/weglot/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/weglot/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Edson Galina Fortes](https://wordpress.org/support/users/glx77/)
 * Last activity: [2 years, 10 months ago](https://wordpress.org/support/topic/fix-php-hook/#post-16778917)
 * Status: resolved