JW 플레이어와 관련된 모든 미리보기 비디오 링크를 재생하고 싶습니다. ww 용 jw player & jw player 7을 설치합니다. 하지만 그것은 새로운 게시물에만 영향을 미칠 수 있습니다! 어떻게 기본 WordPress 비디오 플레이어로 바꿀 수 있습니까?기본 플레이어를 JW 플레이어로 변경
1
A
답변
1
필요에 따라 적용 할 작은 스크립트 (다시 삭제하려면 delete_option 행의 주석 처리를 제거하십시오)를 function.php에 넣으십시오.
이 스크립트는 모든 게시물을 찾고 새 shortcode 태그로 바꿉니다.
get_shortcode_regex()
과 has_shortcode
은 shortcode가 등록 된 shortcode (add_shortcode()를 통해 추가, 끝에 dummy_shortcode()
참조)가되어야합니다. has_shortcode()
함께
add_action('init', 'se_40815010');
function se_40815010(){
if(get_option('se_40815010') == true){
return;
}
$old_tag = 'video';
$new_tag = 'jw7-video';
$args = array(
'post_type' =>'post',
'posts_per_page'=> -1,
'post_status' => 'any'
);
$posts = new WP_Query($args);
foreach($posts->posts as $post){
if(has_shortcode($post->post_content, $old_tag)){
$pattern = get_shortcode_regex();
if ( preg_match_all('/'. $pattern .'/s', $post->post_content, $matches)
&& array_key_exists(2, $matches)
&& in_array($old_tag, $matches[2])) {
$new_content = str_replace($matches[2][0], $new_tag, $post->post_content);
$post_update = array(
'ID'=> $post->ID,
'post_content'=> $new_content
);
$update = wp_update_post($post_update, true);
if($update && !is_wp_error($update)){
$result .= 'Post ID '.$post->ID.', gallery shortcode modified.</br>';
}
else{
$error_string = $update->get_error_message();
$result .= '<div id="message" class="error"><p>' . $error_string .'</p></div>';
}
}
}
}
wp_mail(get_option('admin_email'), 'Shortcode replace', $result);
update_option('se_40815010', true);
}
// delete_option('se_40815010');
은 단축 코드는 add_shortcode()
으로 인식하도록 등록되어야한다. 가짜 단축 코드를 만들면 찾고있는 이전 태그가 인식됩니다.
if(get_option('se_40815010')!= true){
add_shortcode('fakegallery', 'dummy_shortcode');
}
function dummy_shortcode($content){
return 'hello world';
}
희망 하시겠습니까?
관련 문제
- 1. kaltura 임베디드 플래시 플레이어를 JW 플레이어로 대체하는 방법
- 2. JQuery가 JW 플레이어로 교체하지 못합니다.
- 3. JW 플레이어로 mp4를 재생할 수 없습니다.
- 4. MX 플레이어를 안드로이드 응용 프로그램의 기본 플레이어로 추가하는 방법은 무엇입니까?
- 5. WordPress에 jw 플레이어를 삽입해도 높이가 인정되지 않습니다.
- 6. FLV 플레이어로 앞으로 닦아 낼 수 있습니까?
- 7. JW Player - 이벤트 핸들러가있는 여러 플레이어를 중지 (대상)
- 8. 크롬이 PHP/JS로 여러 JW 플레이어를 생성하지 못했습니다.
- 9. asp C# 페이지에 jw 플래시 플레이어를 내장하는 방법은 무엇입니까?
- 10. ffmpeg를 사용하여 변환 된 mp4 파일 JW 플레이어를 재생하지 않음
- 11. XSVF 플레이어로 FPGA로드 확인
- 12. 플래시 플레이어로 데스크톱 스트리밍
- 13. Jw 플레이어의 크로스 도메인 오류
- 14. 미디어 플레이어로 미디어를 재생하는 방법
- 15. JW 플레이어 사용자 정의
- 16. iOS App : Flash Player를 webview에서 기본 플레이어로 바꿉니다.
- 17. 기본 키를 사용하여 플레이어를 이동하십시오
- 18. 임베디드 JW 플레이어
- 19. JW Player 플렉스 통합
- 20. JW-Player - 언로드하는 방법?
- 21. 광고가있는 동영상 플레이어 - JW? Flowplayer?
- 22. JW 플레이어가 여러 명입니까?
- 23. Android의 JW Player에서 동영상이 재생되지 않습니다.
- 24. JW Player : 마지막 프레임에서 JW Player를 중지하십시오.
- 25. JW 플레이어 문제가 여기에있는 JW 플레이어
- 26. fancybox에 JW 플레이어 - (youtube link into JW)
- 27. 루프에서 비디오 플레이어를 표시하는 방법
- 28. 어떻게하면 안드로이드에서 vitamio 플레이어를 사용할 수 있습니까?
- 29. JW 플레이어 레벨이 작동하지 않습니다.
- 30. mediaelementjs를 유연한 플래시 플레이어로 사용
Jw 플레이어가 어떤 종류의 shortcode를 게시물에 추가합니까? – Benoti
이 플러그인을 사용했습니다. wordpress.org/plugins/simple-shortcode-for-jw-player-7/... [jw7-video] – Mohammad