Commit 0df276aa by Arun Raj

curl call for news

parent 85b6480f
...@@ -394,6 +394,42 @@ function ws_get_images_urls( $object, $field_name, $request ) { ...@@ -394,6 +394,42 @@ function ws_get_images_urls( $object, $field_name, $request ) {
); );
} }
add_action('transition_post_status', 'func', 10, 3);
function func($new_status, $old_status, $post)
{
$category_detail=get_the_category($post->ID);//$post->ID
//echo "<PRE>";print_r($category_detail);exit;
foreach($category_detail as $cd)
{
if($cd->slug=='news')
{
$curl = curl_init( 'http://52.55.205.218:5555/notification/sendnotificationtoall' );
curl_setopt( $curl, CURLOPT_POST, true );
curl_setopt( $curl, CURLOPT_POSTFIELDS, array( 'message' => 'some data', 'title' => 'some more data' ) );
curl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );
$response = curl_exec( $curl );
curl_close( $curl );
}
}
}
/********* Saasvaap Edited *****************/ /********* Saasvaap Edited *****************/
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment