Bạn đang chuyển thông số yêu cầu không chính xác
Hãy xem trang Codex. Bạn có thể tìm thấy ví dụ như vậy trong đó
$response = wp_remote_post[ $url, array[ 'method' => 'POST', imeout' => 45, 'redirection' => 5, 'httpversion' => '1.0', 'blocking' => true, 'headers' => array[], 'body' => array[ 'username' => 'bob', 'password' => '1234xyz' ], 'cookies' => array[] ] ];
Vì vậy, trong trường hợp của bạn, nó sẽ trông giống như thế này
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];
trình bày bởi. Wordpress/Stackoverflow
Trong bài viết trước, chúng tôi đã xem xét các bài viết trước về yêu cầu GET, cơ sở PHP gốc để tạo yêu cầu và xem xét chức năng API WordPress
309 cùng với các đối số mà nó cung cấp
Trong bài viết này, chúng tôi sẽ sử dụng
309 để chúng tôi thực sự có thể thấy nó hoạt động. Hãy nhớ rằng điều này - chẳng hạn như
309 - là một phần của API HTTP trong đó có các chức năng khác đáng xem xét
Tuy nhiên, hiện tại, chúng tôi sẽ đưa
309 vào hoạt động
Cụ thể chúng ta sẽ làm như sau
- Khi tải trang, chúng tôi sẽ gửi một số thông tin tới tập lệnh tùy chỉnh
- Tập lệnh sẽ kiểm tra thông tin và đưa nó trở lại trang của chúng tôi
- Sau đó chúng tôi sẽ hiển thị dữ liệu trên trang
Chắc chắn, đó là một ví dụ hơi giả tạo nhưng nó sẽ cho chúng ta kinh nghiệm tạo một tập lệnh PHP riêng biệt có thể được sử dụng cho các hoạt động được kích hoạt bằng cách sử dụng
309
Dù sao, với mục đích của ví dụ này, chúng tôi sẽ sử dụng bộ sưu tập PHP
314 để ghi nhật ký khi người dùng đã gửi tùy chọn của họ thay vì yêu cầu họ phải đăng nhập
Cuối cùng, mã nguồn sẽ được cung cấp trên GitHub và có thể truy cập ở phần cuối của loạt bài này trong bài viết sau
Tuy nhiên, bây giờ, hãy bắt đầu làm việc với plugin
Sắp ra khỏi lớp
Nếu bạn đã theo dõi bất kỳ bài viết nào của tôi trong vài tháng qua, thì bạn biết rằng tôi là người hâm mộ mẫu đơn lẻ và tôi thường sử dụng cùng một bản soạn sẵn để xây dựng các plugin của mình
Cuối cùng, rất nhiều điều này sẽ được lặp đi lặp lại - không sao, bây giờ. Logic nghiệp vụ - hay logic cốt lõi - của plugin là thứ sẽ thay đổi, vì vậy hãy chú ý theo dõi
Chuẩn bị Plugin
Trong thư mục wp-content/plugins của bạn, hãy tạo một thư mục có tên wp-remote-post-example vì đây sẽ là tên của plugin của chúng tôi. Sau đó, tất cả các tệp sau
- wp-remote-post-ví dụ. php
- class-wp-remote-post-ví dụ. php
- wp-remote-receiver. php
Trong wp-remote-post-ví dụ. php, thêm đoạn mã sau
1
2
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];0
3
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];2
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];3
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];4
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];5
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];6
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];7
20
21
22
23
24
25
26
27
28
29
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];00
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];01
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];02
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];03
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];04
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];05
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];06
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];07
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];08
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];09
30
31
32
33
34
35
36
37
38
Sau đó, trong class-wp-remote-post-example. php thêm đoạn mã sau
E
Cuối cùng, thêm dòng sau vào wp-remote-receiver. php
1_______9
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];0
3
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];3
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];59
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];5
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];7
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];62
21
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];64
23
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];66
25
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];32
27
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];70
29
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];01
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];73
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];03
38
Lưu ý rằng chúng ta sẽ lặp qua danh sách dữ liệu
315 và hiển thị nó ở định dạng danh sách giúp dễ đọc
Lưu ý rằng để tiết kiệm dung lượng, tôi sẽ để lại các nhận xét mã từ plugin cụ thể này. File tải về trên GitHub sẽ được ghi đầy đủ và cũng sẽ có trong bài tiếp theo
Tại thời điểm này, bạn sẽ có thể kích hoạt plugin;
cái này tốt
Nhận thông tin yêu cầu
Tại thời điểm này, hãy thu thập thông tin mà chúng tôi muốn gửi như một phần của yêu cầu. Cụ thể, chúng ta hãy lấy như sau
- Địa chỉ duy nhất của khách truy cập
- Địa chỉ trang chủ của blog
- Địa chỉ của trang đang được truy cập
Thêm dòng sau vào hàm tạo [hàm
316 riêng tư, không phải là hàm
317 công khai]
___8____9
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];78
Tiếp theo, thêm chức năng sau vào lớp
1_______9
201
3
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];3
204
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];5
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];7
207
21
209
23
211
25
27
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];32
29
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];01
217
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];03
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];04
31
Ở đây, chúng tôi đang lấy ID duy nhất từ chỉ mục
318 của bộ sưu tập
314, chúng tôi đang lấy URL của trang web do WordPress xác định và sau đó chúng tôi lưu trữ permalink của trang hiện tại vào biến riêng của nó
thực hiện yêu cầu
Tại thời điểm này, chúng tôi đã sẵn sàng để thực hiện yêu cầu. Nhớ lại từ bài viết trước rằng có một số thông tin chúng tôi cần gửi cùng với yêu cầu
- URL
- Nội dung của nội dung [mà chúng tôi sẽ sử dụng làm ID duy nhất, Địa chỉ và Trang đã xem
Đủ dễ dàng, phải không?
Vì vậy, hãy tiếp tục cập nhật chức năng của chúng tôi ở trên với khối mã sau để chức năng bây giờ trông như thế này
1
2
201
3
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];3
204
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];5
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];7
207
21
209
23
211
25
27
236
29
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];01
239
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];03
241
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];04
243
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];06
245
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];08
247
30
249
32
251
33
253
35
255
37
257
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];52
259
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];32
261
262
217
264
265
31
Tại thời điểm này, bạn sẽ có thể tải lại trang mặc dù bạn không nhất thiết phải thấy bất kỳ điều gì xảy ra
Thậm chí, nó không có gì quá phức tạp, phải không?
Hiển thị kết quả
Tại thời điểm này, giả sử mọi thứ được kết nối chính xác, bây giờ chúng ta có thể hiển thị kết quả
Để làm điều này, trước tiên chúng ta cần kiểm tra xem có lỗi hay không, sau đó hiển thị thông báo nếu có;
Thêm điều kiện sau vào hàm trên ngay dưới lệnh gọi
309
1
2
269
3
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];3
272
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];5__
274
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];7
276
21
23
31
25
281
27
29
284
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];01
286
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];03
288
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];04
276
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];06
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];08
31
30__6___2
Lưu ý rằng chúng tôi đang chọn nối thêm một số HTML dựa trên phản hồi sẽ hiển thị ở cuối bài đăng
Phiên bản làm việc hiện tại
Tại thời điểm này, phiên bản làm việc hiện tại của plugin sẽ trông như thế này
1
2
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];0
3
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];23
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];3
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];5
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];26
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];7
21
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];29
23
25
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];010
27
29
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];32
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];01
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];03
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];35
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];04
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];06
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];38
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];08
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];40
30
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];42
32
33
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];45
35
37
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];32
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];52
259
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];032
261
262
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];035
264
265
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];038
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];039
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];040
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];041
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];042
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];043
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];044
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];045
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];046
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];047
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];048
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];049
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];050
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];051
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];052
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];053
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];054
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];055
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];056
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];057
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];058
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];059
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];060
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];061
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];062
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];063
253
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];065
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];066
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];067
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];068
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];069
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];070
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];071
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];072
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];073
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];074
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];075
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];076
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];077
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];078
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];079
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];080
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];081
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];082
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];083
$args = array[ 'method' => 'POST', 'headers' => array[ 'Content-type: application/x-www-form-urlencoded' ], 'sslverify' => false, 'body' => array[ 'api' => get_option['API_key'], 'gw' => '1' ] ]; $api_response = wp_remote_post['//myurl.com/api', $args];084___
Trong bài đăng tiếp theo và cũng là bài đăng cuối cùng của loạt bài này, chúng tôi sẽ nỗ lực làm cho thông tin được thêm vào cuối bài đăng trông gọn gàng hơn một chút thông qua việc sử dụng LESS cho CSS chỉ để có một số kinh nghiệm về điều đó và để tiếp tục cải thiện
Chúng tôi cũng sẽ đảm bảo rằng plugin được ghi lại đầy đủ và có sẵn trên GitHub để xem xét thêm
Cho đến lúc đó, hãy tìm hiểu những gì chúng tôi đã đề cập ở đây và chúng tôi sẽ có nhiều điều hơn để chia sẻ trong bài viết cuối cùng