WordPress Subscribe2 플러그인은 이메일을 보낼 때 블로그 이름으로 문자를 피합니다.

StackOverflow https://stackoverflow.com/questions/1329205

문제

다가오는 새로운 WordPress 블로그에서 Subscribe2 플러그인을 사용하고 있습니다.http://www.adlerr.com). 내 블로그 제목은 "Roee Adler의 블로그"입니다. 이메일을 보낼 때 Bubscribe2는 내 블로그 제목에서 Apostrophe를 탈출하며 이메일 주제는 다음과 같이 수신됩니다.

[Roee Adler's Blog] Please confirm your request

이메일 본문은 다음과 같습니다.

Roee Adler's Blog has received a request to 
subscribe for this email address. To complete your 
request please click on the link below:
...

나는 자연스럽게 제목과 본문에 내 블로그 이름의 "정상적인"버전을 갖고 싶습니다.

나는이 질문을했다 doctype.com 성공없이 (여기 질문이 있습니다) 그러나, 나는 이것을 이해했다는 것을 이해한다는 것을 이해했다는 것은 아마도 플러그인의 PHP 코드를 변경해야 할 것입니다.

DocType에서받은 답변을 따라 다음과 같은 코드 섹션을 변경했습니다.

function substitute($string = '') {
    if ('' == $string) {
        return;
    }
    $string = htmlspecialchars_decode(str_replace("BLOGNAME", get_option('blogname'), $string));
    $string = str_replace("BLOGLINK", get_bloginfo('url'), $string);
    $string = htmlspecialchars_decode(str_replace("TITLE", stripslashes($this->post_title), $string));
    $string = str_replace("PERMALINK", $this->permalink, $string);

위의 코드에서 나는 a를 추가했다 htmlspecialchars_decode Blogname과 제목의 생성을위한 래퍼하지만 이메일 주제와 신체에는 여전히 '.

이것을 해결하기 위해 무엇을 할 수 있습니까?

감사

도움이 되었습니까?

해결책

에 따라 문서 htmlspecialchars_decode, 당신은 통과해야합니다 ENT_QUOTES 로서 $quote_style 변환 할 논쟁 ' 에게 '. 설정해보십시오 ENT_QUOTES:

function substitute($string = '') {
        if ('' == $string) {
                return;
        }
        $string = htmlspecialchars_decode(str_replace("BLOGNAME", get_option('blogname'), $string), ENT_QUOTES);
        $string = str_replace("BLOGLINK", get_bloginfo('url'), $string);
        $string = htmlspecialchars_decode(str_replace("TITLE", stripslashes($this->post_title), $string), ENT_QUOTES);
        $string = str_replace("PERMALINK", $this->permalink, $string);

다른 팁

WordPress는 블로그 제목의 Apostrophe를 대체합니다 ' 데이터베이스에 저장하기 전에. 이를 재정의하려면 functions.php 파일을 편집하고 다음 진술을 삽입하십시오.

update_option("blogname", "My Blog's Title With Apostrophe");

그것은 제목이 당신이 입력 한 것과 정확히 일하도록 강요 할 것입니다. 설정 메뉴에서 작성하는 블로그 제목 변경에는 영향을 미치지 않습니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top