add theme support - register_theme_directory() not working from mu-plugin

I have a must use plugin that uses register_theme_directory() but no matter what path I pass in, it always returns false

I have a must use plugin that uses register_theme_directory() but no matter what path I pass in, it always returns false.

For some background I am using domain based database switching in the wp-config to manage multiple distinct sites with one install, (i am not using a network install because each site needs it own unique users database). I have some themes I want to only be available to one specific site, so I put it in a special directory and try to register the theme directory in a mu-plugin if the domain is accessed.

Here is the relevant portion of my directory-structure:

wp-content
 |-> site-themes
      |-> site-a
           |-> theme-1
           |-> theme-2

I have tried the following:

if ( [check site domain ] ) {
    register_theme_directory( '[wordpress root]/wp-content/site-themes/site-a' );
}

When that didn't work I figured it must need each theme to have its directory registered so I tried this:

if ( [check site domain ] ) {
    register_theme_directory( '[wordpress root]/wp-content/site-themes/site-a/theme-1' );
    register_theme_directory( '[wordpress root]/wp-content/site-themes/site-a/theme-2' );
}

But that didn't work either. I am sure I am missing something simple. Any suggestions?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745277340a4620116.html

相关推荐

  • add theme support - register_theme_directory() not working from mu-plugin

    I have a must use plugin that uses register_theme_directory() but no matter what path I pass in, it always returns false

    3小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信