wpml_media_url
- النوع
- filter
- الفئة
- استرداد المحتوى المحلي
- إصدار WPML
- 4.6.10
الوصف
ملاحظة: يتوفر هذا المرشِّح بدءاً من WPML Media Translation 2.7.4
يتيح لك هذا المرشِّح تحويل عنوان 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