Title: $redirection should declared as global, explicitly
Last modified: August 20, 2016

---

# $redirection should declared as global, explicitly

 *  [Ka Yue](https://wordpress.org/support/users/kayue/)
 * (@kayue)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/redirection-should-declared-as-global-explicitly/)
 * In the last line of redirection/redirection.php
 * $redirection should declared as global, explicitly, because if I initiate WordPress
   inside a class, then all variables will be set as global variable. For example,
   this Symfony bundle: [https://github.com/kayue/WordpressBundle/blob/master/Wordpress/ApiLoader.php#L73](https://github.com/kayue/WordpressBundle/blob/master/Wordpress/ApiLoader.php#L73)
 * This can be fix by simply using this line:
 * $GLOBALS[‘redirection’] = new Redirection;
 * [http://wordpress.org/extend/plugins/redirection/](http://wordpress.org/extend/plugins/redirection/)

The topic ‘$redirection should declared as global, explicitly’ is closed to new 
replies.

 * ![](https://ps.w.org/redirection/assets/icon-256x256.jpg?rev=983639)
 * [Redirection](https://wordpress.org/plugins/redirection/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/redirection/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/redirection/)
 * [Active Topics](https://wordpress.org/support/plugin/redirection/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/redirection/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/redirection/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Ka Yue](https://wordpress.org/support/users/kayue/)
 * Last activity: [14 years, 4 months ago](https://wordpress.org/support/topic/redirection-should-declared-as-global-explicitly/)
 * Status: not resolved