WordPress Theme Exists and WP_THEME_DIR?

This is more of an open question than a fantastic discovery. One thing we want to do with WPBook is allow custom theme modification that won’t be overwritten by plugin upgrades. I’ve been looking into ways to check to see if a theme exists. If it does uses it if not use the default plugin theme from the plugin directory.

I know how to do a php check for “if file_exists” however, checking for all theme files seems a bit silly. What I’m wondering is if there is a way to check if the theme exists with at least a folder and index.php file.

Another thing I’ve been wondering, there is a WP_PLUGIN_DIR function but not WP_THEME_DIR function is there a workaround for this?

Any help on this issue would be great!

2 thoughts on “WordPress Theme Exists and WP_THEME_DIR?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.