Skip to content
Advertisement

PHP Namespace 5.3 and WordPress Widget

I am using namespaces.

I try to create a WordPress widget (http://codex.wordpress.org/Widgets_API)

With namespaces the following gives an error because the arguments can not be passed (and without namespaces it obviously works like usual)

JavaScript

uhm… what is the correct syntax for ‘parent::WP_Widget’ using namespaces?

(the COMPLETE error message is:

JavaScript

)

And the debugger shows nothing has been passed:

JavaScript

(only the $name is required)

Advertisement

Answer

It seems to me your problem is not in the namespaces, the following code works like a charm:

JavaScript

If you get an error message, it might be helpful to state what it says.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement