run_replace get_config()

run_replace get_config()

QA

run_replace get_config()

답변 1

본문

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

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

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

 


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

그렇습니다.

 

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

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 123,663
© SIRSOFT
현재 페이지 제일 처음으로