Title: global php var in widget
Last modified: August 19, 2016

---

# global php var in widget

 *  Resolved [brainzina](https://wordpress.org/support/users/brainzina/)
 * (@brainzina)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/global-php-var-in-widget/)
 * Hi !!
 * I’m trying to build a widget to show me some photos from my flickr photostream.
   I already have the application and I was just setting it up as a plugin / widget.
   
   After an afternoon of work most of the things work fine but the widget won’t 
   run correct.
 * It seams like wp is having problems with global php vars in the form function
   in die widget class. I have to access two global vars (arrays) which store the
   usernams and avalible methods so I paste “global $bfp_users” into the first line
   after “function form($instance) {” and the widget option page in the admin panel
   won’t show correctly (it only loads half and doesn’t work). When I remove this
   line and refresh the admin page it show fine.
 * I don’t understand the problem, can somebody help me?!
 * Thanks,
    brainzina

Viewing 1 replies (of 1 total)

 *  Thread Starter [brainzina](https://wordpress.org/support/users/brainzina/)
 * (@brainzina)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/global-php-var-in-widget/#post-1685522)
 * anyone ??

Viewing 1 replies (of 1 total)

The topic ‘global php var in widget’ is closed to new replies.

 * 1 reply
 * 1 participant
 * Last reply from: [brainzina](https://wordpress.org/support/users/brainzina/)
 * Last activity: [15 years, 7 months ago](https://wordpress.org/support/topic/global-php-var-in-widget/#post-1685522)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
