채택완료

run_replace get_config()

domain.com 은 basic 테마를 사용하고

sub.domain.com 은 sub 테마를 사용하려고 

extend 폴더 안에 draft.theme.php 파일을 만들었습니다.

 

Copy
add_replace('get_config', 'get_draft_theme', 10, 5);
function get_draft_theme($cache) 
{
    //print_r($cache);
    preg_match('/^([^\.]+).*/i', $_SERVER['HTTP_HOST'], $matches);
    if ($matches[1] && file_exists(G5_PATH.'/'.G5_THEME_DIR.'/'.$matches[1].'/theme.config.php')) {
        $cache['cf_theme'] = $matches[1];
    }
    return $cache;
}

 

G5_THEME_PATH 상수 정의가

common.php 파일

$config = get_config(); 구문 다음에 있어서

get_config() 함수에서 바꿔야 할 것 같은데 

run_replace 가 작동을 안해서요...

common.php get_config() 함수 호출전에 add_replace를 해야되나요?

 

|

답변 1개 / 댓글 1개

채택된 답변
+20 포인트

그렇습니다.

 

common.php get_config() 함수 호출전에 add_replace를 해야 적용됩니다.

답변에 대한 댓글 1개

감사합니다
어떻게 할까 하다
dbconfig.php 에 넣어버렸어요~ ㅋ

답변을 작성하려면 로그인이 필요합니다.