2013-05-01 6 views
0

간단한 텍스트 필드의 샷 코드를 사용자 정의 필드 (간단한 필드 WordPress 플러그인에 속함)로 사용하고 싶습니다. 이제이간단한 필드 (사용자 정의 필드) 내에서 단축 코드 실행

모든 솔루션은 높게 평가 될 것이다 ..here 내가 단축 코드를 사용하여 사용하고자하여 HTML입니다 ..

[caption]Testing[/caption]에 HTML 형식의 ..while 내가 만든 자막 반환을 실행하지 ..

<div class="box_wrap clearfix"> 
    <div clas="heading"> 
    Call to Action 
    </div> 
    <div class="box"> 
    &nbsp; 
    </div> 
</div> 

n이 짧은 코드를 사용자 정의 텍스트 파일로 작성하여이 HTML을 실행합니다! 1

고마워요! the_content 표시되면

답변

0

은 단축 코드의 API는 별도로, 예컨대 "[myshortcode]"임의 등록 단축 코드를 분석하고 어느 경우 속성 및 콘텐츠를 분석하고 그들에게 대응 단축 코드 핸들러 함수를 전달한다. 단축 코드 처리기가 반환 한 (반향되지 않은) 문자열은 단축 코드 자체 대신 게시물 본문에 삽입됩니다. otherwords에서

당신은 the_content에게 필터를 적용 할 필요가 어디 템플릿 콘텐츠 당신이 출력. 이 같은

그래서 대신 가진 코드 :이 대신

echo get_post_meta(get_the_ID(), 'your_meta_key', true); 

사용 :

// Get your custom meta data using get_post_meta() function 
$meta_content = get_post_meta(get_the_ID(), 'your_meta_key', true); 

// Then we need to apply 'the_content' filter on the $meta_content 
echo apply_filters('the_content', $meta_content); 

그리고 당신의 단축 코드가 고려되어야한다. Shortcode API here -
: 당신이있는 단축 코드를 ... 등록한 경우

은에 대해 자세히 알아보십시오.
-the_content filter here.
- apply_filters() function here.