Last active
January 18, 2024 13:22
-
-
Save yeriepiscesa/2a59ea2d0aa01b71461555ca58bf3ebd to your computer and use it in GitHub Desktop.
API Wilayah Indonesia WordPress
This file contains 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
<!-- Contoh Penggunaan pada contact form 7 (tab Formulir) --> | |
<label> Nama Anda | |
[text* your-name autocomplete:name] </label> | |
<!-- class "fieldgroup--wilayah" digunakan untuk mengelompokan pemilihan provinsi sampai kelurahan --> | |
<div class="fieldgroup--wilayah"> | |
<!-- untuk mengakses data provinsi, tambahkan class "field--wilayah-provinsi" --> | |
<!-- class "field--wilayah-provinsi-title" agar ketika provinsi dipilih, informasi nama provinsi diset ke field dengan class -title --> | |
<label>Provinsi | |
[select provinsi class:field--wilayah-provinsi] | |
</label>[hidden provinsi-title class:field--wilayah-provinsi-title] | |
<label>Kabupten / Kota | |
[select kabkota class:field--wilayah-kabkota] | |
</label>[hidden kabkota-title class:field--wilayah-kabkota-title] | |
<label>Kecamatan | |
[select kecamatan class:field--wilayah-kecamatan] | |
</label>[hidden kecamatan-title class:field--wilayah-kecamatan-title] | |
<label>Kelurahan | |
[select kelurahan class:field--wilayah-kelurahan] | |
</label>[hidden kelurahan-title class:field--wilayah-kelurahan-title] | |
</div> | |
<h4>Tujuan</h4> | |
<div class="fieldgroup--wilayah"> | |
<label>Provinsi | |
[select dest_provinsi class:field--wilayah-provinsi] | |
</label>[hidden dest_provinsi-title class:field--wilayah-provinsi-title] | |
<label>Kabupten / Kota | |
[select dest_kabkota class:field--wilayah-kabkota] | |
</label>[hidden dest_kabkota-title class:field--wilayah-kabkota-title] | |
<label>Kecamatan | |
[select dest_kecamatan class:field--wilayah-kecamatan] | |
</label>[hidden dest_kecamatan-title class:field--wilayah-kecamatan-title] | |
<label>Kelurahan | |
[select dest_kelurahan class:field--wilayah-kelurahan] | |
</label>[hidden dest_kelurahan-title class:field--wilayah-kelurahan-title] | |
</div> | |
<label> E-mail anda | |
[email* your-email autocomplete:email] </label> | |
<label> Subjek | |
[text* your-subject] </label> | |
<label> Pesan Anda (opsional) | |
[textarea your-message] </label> | |
[submit "Kirim"] |
This file contains 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
<!-- Contoh Penggunaan pada contact form 7 (tab Surat/Mail, bagian Isi Pesan) --> | |
Dari: [your-name] [your-email] | |
Subjek: [your-subject] | |
Lokasi : | |
[provinsi] - [provinsi-title] | |
[kabkota] - [kabkota-title] | |
[kecamatan] - [kecamatan-title] | |
[kelurahan] - [kelurahan-title] | |
Tujuan : | |
[dest_provinsi] - [dest_provinsi-title] | |
[dest_kabkota] - [dest_kabkota-title] | |
[dest_kecamatan] - [dest_kecamatan-title] | |
[dest_kelurahan] - [dest_kelurahan-title] | |
Isi Pesan: | |
[your-message] |
This file contains 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
GET https://your-domain.com/wp-json/wilayah/v1/provinsi | |
GET https://your-domain.com/wp-json/wilayah/v1/kabkota/<id_propinsi> | |
GET https://your-domain.com/wp-json/wilayah/v1/kecamatan/<id_kabkota> | |
GET https://your-domain.com/wp-json/wilayah/v1/kelurahan/<id_kecamatan> | |
# Pagination | |
GET https://your-domain.com/wp-json/wilayah/v1/provinsi?per_page=10&page=1 | |
GET https://your-domain.com/wp-json/wilayah/v1/kabkota/<id_propinsi>?per_page=10&page=1 | |
GET https://your-domain.com/wp-json/wilayah/v1/kecamatan/<id_kabkota>?per_page=10&page=1 | |
GET https://your-domain.com/wp-json/wilayah/v1/kelurahan/<id_kecamatan>?per_page=10&page=1 | |
# Search | |
GET https://your-domain.com/wp-json/wilayah/v1/provinsi?term=whatToSearch | |
GET https://your-domain.com/wp-json/wilayah/v1/kabkota/<id_propinsi>?term=whatToSearch | |
GET https://your-domain.com/wp-json/wilayah/v1/kecamatan/<id_kabkota>?term=whatToSearch | |
GET https://your-domain.com/wp-json/wilayah/v1/kelurahan/<id_kecamatan>?term=whatToSearch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Download plugin disini
https://demo-komunitas.solusipress.com/api-wilayah-indonesia/