Title: Sam's Replies | WordPress.org

---

# Sam

  [  ](https://wordpress.org/support/users/figaroo/)

 *   [Profile](https://wordpress.org/support/users/figaroo/)
 *   [Topics Started](https://wordpress.org/support/users/figaroo/topics/)
 *   [Replies Created](https://wordpress.org/support/users/figaroo/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/figaroo/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/figaroo/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/figaroo/engagements/)
 *   [Favorites](https://wordpress.org/support/users/figaroo/favorites/)

 Search replies:

## Forum Replies Created

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

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Camera slideshow] Scroll breaks after opening media library dialog](https://wordpress.org/support/topic/scroll-breaks-after-opening-media-library-dialog/)
 *  Thread Starter [Sam](https://wordpress.org/support/users/figaroo/)
 * (@figaroo)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/scroll-breaks-after-opening-media-library-dialog/#post-5712183)
 * The `pix_thickbox.js` script is the cause of the problem. All this script does
   is overwrite the already defined tb_remove function, but it does so forgetting
   the removal of the `modal-open` class on the body element. Why is this file necessary?
   WP already defines this `tb_remove` function. I commented this file out and things
   are working better now. Scroll will resume back to normal after closing the modal
   window.
 * Is there a github page for this project so that way I can give you pull-requests
   for these fixes that I’m doing?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [Uploading Images in Widget Form](https://wordpress.org/support/topic/uploading-images-in-widget-form/)
 *  Thread Starter [Sam](https://wordpress.org/support/users/figaroo/)
 * (@figaroo)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/uploading-images-in-widget-form/#post-1712723)
 * I found that I can include wp-admin/admin.php for all the wordpress functions.
   But my uploads.php file is located in a theme directory (/wp-content/themes/mytheme/
   functions/admin/uploads.php), and because of this WordPress logs me out of admin
   whenever I visit uploads.php. Weird. The login system for WordPress is probably
   limited to only wp-admin?
 * It would be a bad thing if I just move my uploads.php file to the wp-admin directory
   because then that’s modifying the standard WordPress install. I’d much rather
   keep all my files in the theme directory (wp-content).
 * WordPress obviously include my theme files for every page visit, including pages
   in the admin area. For example, WordPress includes functions.php on both the 
   admin area and the site. Though, before WordPress includes functions.php it includes
   some of it’s API. I need to do this on my own in uploads.php (my custom file).
   I need uploads.php to include the right files for authentication. I need it also
   to include the right files for wp_handle_upload and get_option.
 * I’ll keep looking into the WP source code till I get a reply. 😀
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [Uploading Images in Widget Form](https://wordpress.org/support/topic/uploading-images-in-widget-form/)
 *  Thread Starter [Sam](https://wordpress.org/support/users/figaroo/)
 * (@figaroo)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/uploading-images-in-widget-form/#post-1712719)
 * Actually, from the looks of it, PHP stores widget options in the wp_options table
   in the database. All I need to do is this:
 *     ```
       $options = get_option('widget_mywidgetname');
       $options[$_POST['instance_number']]['someoption'] = 'new value';
       update_options('widget_mywidgetname', $options);
       ```
   
 * I just need to know how to include these WordPress functions into a custom file.

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