WPML
wpml_media_url
유형
filter
WPML 버전
4.6.10

설명

참고: 이 필터는 WPML 미디어 번역 2.7.4부터 사용할 수 있습니다.

이 필터를 사용하면 미디어 URL을 현재 언어 또는 지정된 대상 언어로 변환할 수 있습니다. 필터에 언어를 지정하지 않으면 기본적으로 현재 언어를 사용합니다.

인수

$url
(문자열) (필수) 미디어 URL입니다.
$language
(문자열) (선택 사항) 대상 언어의 언어 코드입니다. 기본값은 현재 언어입니다.

사용 예시

예제
// Convert the media URL to the current language.
apply_filters( 'wpml_media_url', 'https://example.com/wp-content/uploads/dog.jpg' );

// Convert the media URL to French.
apply_filters( 'wpml_media_url', 'https://example.com/wp-content/uploads/dog.jpg', 'fr' );

// Convert the media thumbnail URL to French.
apply_filters( 'wpml_media_url', 'https://example.com/wp-content/uploads/dog-150x150.jpg', 'fr' );

wpml_media_id, force_suppress_filters, wpml_get_translated_slug, wpml_home_url, wpml_translate_single_string, wpml_translate_string, wpml_elements_without_translations, wpml_permalink, wpml_unfiltered_admin_string, wpml_element_link

모든 현지화된 콘텐츠 가져오기 훅 12개 →