WPML
wpml_media_id
ประเภท
filter
เวอร์ชันของ WPML
4.6.10

คำอธิบาย

หมายเหตุ: ฟิลเตอร์นี้มีให้ใช้งานตั้งแต่ WPML Media Translation 2.7.4

ฟิลเตอร์นี้ช่วยให้คุณสามารถแปลง ID ของสื่อเป็นภาษาปัจจุบันหรือภาษาปลายทางที่ระบุได้ หากไม่ได้ระบุภาษาให้กับฟิลเตอร์ ระบบจะใช้ภาษาปัจจุบันโดยค่าเริ่มต้น

อาร์กิวเมนต์

$id
(int) (จำเป็น) ID สื่อ
$language
(string) (ตัวเลือก) รหัสภาษาของภาษาปลายทาง ภาษาปัจจุบันคือภาษาเริ่มต้น

ตัวอย่างการใช้งาน

ตัวอย่าง
// Convert the media ID to the current language.
apply_filters( 'wpml_media_id', 123 );

// Convert the media ID to French.
apply_filters( 'wpml_media_id', 123, 'fr' );

wpml_media_url, 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 รายการ →