Reorganization of namespaces

Ok. Problem solved. I added plugin as i said to manage autoloader and other stuff. I changed my autoloader and thanks to that i have one in place of 3. Solution was to change one piece of directory with plugin name.This is my autoloader now: public function xx_main_plugin( $class ) { $array = explode(‘\\’, $class); … Read more

How to call a WP Class inside my theme

You should be able to do something like this: $wp_customize = new \WP_Customize_Manager(); …since, as I understand it, WordPress core puts all its classes, functions, etc. in the global namespace. Edit It appears that $wp_customize may be a bad example, as it’s a global variable (so, in your theme, all you should need to do … Read more

add_action in namespace not working

Before going too far down this path I would suggest that you familiarize yourself with PHP name resolution rules. To answer your actual question – When you namespace functions, the fully qualified name of those functions includes the namespace. In your example, you have defined two functions: \myPlugin\add_activation_notice and \myPlugin\activation_notice. When calling either of these … Read more