Created
August 20, 2021 07:04
-
-
Save vulieumang/fb1c60d44790a01550f3419365f2b1f1 to your computer and use it in GitHub Desktop.
Translate wpDiscuz from label
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// using chrome and press translate and using this script in console | |
// sử dụng chrome để dịch trang, sau đó dùng script ở console, script sẽ copy label to input | |
let products = []; | |
let product_wrapper = document.querySelectorAll('.wp-list-table tr'); | |
product_wrapper.forEach((product) => { | |
let dataJson = {}; | |
try { | |
dataJson.title = product.querySelector('label font font').innerText; | |
product.querySelector('input').value = dataJson.title; | |
product.querySelector('textarea').value = dataJson.title; | |
} | |
catch (err) { | |
console.log(err) | |
} | |
products.push(dataJson); | |
}); | |
console.log(products); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment