-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathnumofpagesallinone.php
More file actions
28 lines (26 loc) · 834 Bytes
/
numofpagesallinone.php
File metadata and controls
28 lines (26 loc) · 834 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
$file = "https://".$mn_agent_url."/".$mn_agent_folder."/mannanetwork-dir/getNumberOfPagesAllInOne.php";
$response = wp_remote_post(
$file,
array(
'method' => 'POST',
'timeout' => 45,
'redirection' => 5,
'httpversion' => '1.0',
'blocking' => true,
'headers' => array(),
'body' => array(
'category_id' => $category_id,
'tregional_num' => $tregional_num,
),
'cookies' => array(),
)
);
if ( is_wp_error( $response ) ) {
$error_message = htmlspecialchars( $response->get_error_message() );
echo json_encode("Something went wrong: htmlspecialchars($error_message)");
} else {
$number_of_pages = $response['body'];//response is already json encoded at enterprise site - just pass it on encoded and decode when used
//echo $response['body'];
}
?>