Title: Is functions.php called before plugins?
Last modified: August 19, 2016

---

# Is functions.php called before plugins?

 *  Resolved [richarduk](https://wordpress.org/support/users/richarduk/)
 * (@richarduk)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/is-functionsphp-called-before-plugins/)
 * I’m trying to pass a variable to a plugin. The variable is the url of the referring
   page. I’m currently putting the bit of code to get this in functions.php
 * Is functions.php called befoAre plugins?

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

 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [15 years, 8 months ago](https://wordpress.org/support/topic/is-functionsphp-called-before-plugins/#post-1661746)
 * No, the theme’s functions.php file is called well after plugins are loaded.
 *  Thread Starter [richarduk](https://wordpress.org/support/users/richarduk/)
 * (@richarduk)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/is-functionsphp-called-before-plugins/#post-1661755)
 * Thanks.
 * That explains it.
 * Is there a page I can add my code snippet to that’s called before the plugins?
   How about config.php, as that doesn’t get updated?
 *  [Xephan](https://wordpress.org/support/users/xephan/)
 * (@xephan)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/is-functionsphp-called-before-plugins/#post-1661781)
 * If you just need the url of the referring page, you could grab that anywhere 
   using $_SERVER[‘HTTP_REFERER’], there shouldn’t be any need to run other code
   elsewhere.
 *  Thread Starter [richarduk](https://wordpress.org/support/users/richarduk/)
 * (@richarduk)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/is-functionsphp-called-before-plugins/#post-1661834)
 * I want to pass it to the plugin, that’s the problem. I’m guessing that all the
   theme files are called well after the plugins?
 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [15 years, 8 months ago](https://wordpress.org/support/topic/is-functionsphp-called-before-plugins/#post-1661992)
 * The $_SERVER[‘HTTP_REFERER’] is a superglobal. You can get it in plugins directly.
   You don’t need any theme code to do that.
 *  [hospedagem de sites](https://wordpress.org/support/users/hospedagem-de-sites/)
 * (@hospedagem-de-sites)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/is-functionsphp-called-before-plugins/#post-1661995)
 * just as curiosity: what’s the exact output of $_SERVER[‘HTTP_REFERER’]? I need
   the referrer’s URL to lack the ‘[http://wwww.&#8217](http://wwww.&#8217);, how
   could I do that?
 *  [Xephan](https://wordpress.org/support/users/xephan/)
 * (@xephan)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/is-functionsphp-called-before-plugins/#post-1662004)
 * [@hospedagem](https://wordpress.org/support/users/hospedagem/): the exact output
   is the referring page’s url 😉
 * So the only way you can be sure there isn’t the www is to do a str_replace to
   remove any leading www.
 *  Thread Starter [richarduk](https://wordpress.org/support/users/richarduk/)
 * (@richarduk)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/is-functionsphp-called-before-plugins/#post-1662009)
 * Thanks, Otto. In my case it didn’t help, but it’s useful to know.
 *  [toto](https://wordpress.org/support/users/toto/)
 * (@toto)
 * [15 years ago](https://wordpress.org/support/topic/is-functionsphp-called-before-plugins/#post-1662210)
 * Can we modify, add, or change params in plugins through functions.php ?
 * I have a plugin and i wand to change the title of one field in the plugin. But
   every time i update the plugin i loose the changes.
 * Is there a way to modify plugin and to save the changes for future updates of
   these plugins?
 * Thanks friends

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

The topic ‘Is functions.php called before plugins?’ is closed to new replies.

## Tags

 * [edit plugin](https://wordpress.org/support/topic-tag/edit-plugin/)
 * [function.php](https://wordpress.org/support/topic-tag/function-php/)
 * [hack plugin](https://wordpress.org/support/topic-tag/hack-plugin/)
 * [update plugins](https://wordpress.org/support/topic-tag/update-plugins/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 9 replies
 * 5 participants
 * Last reply from: [toto](https://wordpress.org/support/users/toto/)
 * Last activity: [15 years ago](https://wordpress.org/support/topic/is-functionsphp-called-before-plugins/#post-1662210)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
