Title: don&#039;t hardcode wp-content
Last modified: August 20, 2016

---

# don't hardcode wp-content

 *  Resolved [funsail](https://wordpress.org/support/users/funsail/)
 * (@funsail)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/dont-hardcode-wp-content/)
 * don’t contribute to the greatest security risk in wp
    use the variables available
   to you plugins/ultimate-tinymce/addons/jwl_call_wp_load.php
 * [http://wordpress.org/extend/plugins/ultimate-tinymce/](http://wordpress.org/extend/plugins/ultimate-tinymce/)

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

 *  Plugin Author [Josh](https://wordpress.org/support/users/josh401/)
 * (@josh401)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/dont-hardcode-wp-content/#post-3497307)
 * So how do you get the constants.. if you are trying to access them outside of
   a WP file.
 * For instance… ultimate-tinymce/addons/shortcodes/shortcodes.php
 * This file requires the loading of wp-load.php in order to load the globally defined‘
   shortcode_tags’ needed for the addon.
 * What is the best method to access this file… because you can’t use any of the
   WP constants until this file is loaded.
 *  Thread Starter [funsail](https://wordpress.org/support/users/funsail/)
 * (@funsail)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/dont-hardcode-wp-content/#post-3497310)
 * I don’t know, I’m just a user. My wp-content is defined in my
    public_html/wp-
   config.php ‘WP_CONTENT_DIR’
 * I would suggest if you can’t read that, then define your own variable that is
   used across your plugin, and stick it in you main.php and users can change it
   there in one place. Because now you’ve told me I need to search for other place
   to change that setting.
 * Thanks.
 *  Plugin Author [Josh](https://wordpress.org/support/users/josh401/)
 * (@josh401)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/dont-hardcode-wp-content/#post-3497324)
 * Gotcha. I’m working on it now.
 * Apparently, the correct way to do this is via an ajax call to WP and using the
   variable in a script.
 * It’ll take a little trial and error… but I’ll get this updated for my next release.
 * Thank you for your help.
 *  Plugin Author [Josh](https://wordpress.org/support/users/josh401/)
 * (@josh401)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/dont-hardcode-wp-content/#post-3497327)
 * I believe it is fixed 🙂
 *  Thread Starter [funsail](https://wordpress.org/support/users/funsail/)
 * (@funsail)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/dont-hardcode-wp-content/#post-3497328)
 * great thanks!
 *  Plugin Author [Josh](https://wordpress.org/support/users/josh401/)
 * (@josh401)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/dont-hardcode-wp-content/#post-3497329)
 * My pleasure. Thanks for taking the time to “get me moving” on this!
 * May we mark the thread as resolved?

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

The topic ‘don't hardcode wp-content’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/ultimate-tinymce.svg)
 * [Ultimate TinyMCE](https://wordpress.org/plugins/ultimate-tinymce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ultimate-tinymce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ultimate-tinymce/)
 * [Active Topics](https://wordpress.org/support/plugin/ultimate-tinymce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ultimate-tinymce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ultimate-tinymce/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [Josh](https://wordpress.org/support/users/josh401/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/dont-hardcode-wp-content/#post-3497329)
 * Status: resolved