Hi! We’re using what WordPress recommends in their codex:
https://codex.wordpress.org/Widgets_API
We’ll change that code to avoid any compatibility issues.
Thank you for pointing this out.
Best,
Jason
Thread Starter
pepe
(@pputzer)
Thanks. The codex is pretty obsolete at this point (all current API documentation is maintained in the Code Reference). Dynamic functions were a thing back when procedural programming was the norm and PHP namespaces weren’t there yet.
When you have a class, adding an extra (static) method does not pollute the global namespace, so there is no reason for the slower eval/create_function call. (Also, with PHP 5.3+, you could always use an anonymous function.)
True! We added a static method, as we want to keep our compatibility with PHP 5.2. Unfortunately (!) many of our users still use that version of the language.
Best,
Jason