Forums

More dynamic solution for WP_USE_THEMES false (9 posts)

  1. mazooo
    Member
    Posted 1 year ago #

    It appears to me, that it's not possible to find a better and more dynamic solution for the following "hack" in <wordpress_dir>/index.php:

    define('WP_USE_THEMES', false);

    This configuration will be lost once an upgrade is performed - Isn't there an option to do it with wp_options database table?

  2. Mark / t31os
    Moderator
    Posted 1 year ago #

    A hack to do what though, what exactly are you doing? It's hard to have any idea what you're talking about when you provide no context to your question, please clarify what it is speficically you're talking about.

    There's no reason i can think of you'd ever need to edit that line in the index.php file(it can be defined elsewhere, it's a constant after all), so please explain why you think you need to.

  3. mazooo
    Member
    Posted 1 year ago #

    Sorry for the (too) short explanation. Imagine, you would use wordpress only as a content management system (for whatever reason). Say, you use the URL example.com/wp-admin/. In order to make sure, that there is nothing rendered at example.com/, I used the option

    define('WP_USE_THEMES', false);

    This works perfectly fine. It's just not the perfect solution, because I need to be careful after every wordpress upgrade.

  4. Mark / t31os
    Moderator
    Posted 1 year ago #

    Say, you use the URL example.com/wp-admin/. In order to make sure, that there is nothing rendered at example.com

    Sorry i'm not following you, what appears at example.com then? Nothing? You only use the admin side?

    I used the option

    define('WP_USE_THEMES', false);

    Used it where, in a core WordPress file, in an external file, in a theme/plugin file?

  5. jaapmarcus
    Member
    Posted 1 year ago #

    Place it in wp-config.php that file isn't updated by a new update

  6. Mark / t31os
    Moderator
    Posted 1 year ago #

    Ok, but what makes you think defining a constant in the config file is wrong, that's the perfect place to have it if you need to disable themes.

    Else, you'll need to explain yourself a little more... Please.. :)

  7. mazooo
    Member
    Posted 1 year ago #

    @jaapmarcus:
    Good idea but not the solution, since /index.php would redefine to true in an out-of-the-box installation. And we do not want to change code which will be lost at the next update.

    @Mark:
    Yes, I already mentioned earlier, I use only the admin site. Do you really need to know why I need only the admin site? :)
    Using define('WP_USE_THEMES', false) in /index.php works fine, I will have to set it to false in every Update though.

  8. Rev. Voodoo
    Volunteer Moderator
    Posted 1 year ago #

    Do you really need to know why I need only the admin site

    Well technically no.... but sometimes someone asks for something, and we don't quite use the same terminology/thought process

    So if we are able to visualize the end result/use we can help get to the desired outcome....

  9. mazooo
    Member
    Posted 1 year ago #

    So, I am using the admin site as a backend for an iApp. The iApp does requests on an extract script, which gets some data from the fantastic wp data model and returns it to the iApp in JSON.

Topic Closed

This topic has been closed to new replies.

About this Topic