Title: XML-RPC php function With Custom Fields Not Working!
Last modified: August 19, 2016

---

# XML-RPC php function With Custom Fields Not Working!

 *  [pcmehrdad](https://wordpress.org/support/users/pcmehrdad/)
 * (@pcmehrdad)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/xml-rpc-php-function-with-custom-fields-not-working/)
 * I Use This Function for my sites:
 *     ```
       function my_xmlrpc_post($title,$body,$username,$password,$imdb_id,$pooster,$download_links,$categories = array(1)){
       	$rpcurl = 'http://www.imdbdl.com/xmlrpc.php';
           implode(",", $categories);
       	$XML = "<title>$title</title>".
       	"<category>$categories</category>".
       	$body;
       	$cflds = array(
       		array( 'key' => 'imdb_id', 'value' => $imdb_id ),
       		array( 'key' => 'pooster', 'value' => $pooster ),
       		array( 'key' => 'download_links', 'value' => $download_links )
       	);
       	$content = array('post_type' => 'post', 'title' => $title, 'description' => $body, 'custom_fields' => $cflds);
       	$params = array('',$username,$password,$content,$XML,1);
       	$request = xmlrpc_encode_request('blogger.newPost',$params);
       	$ch = curl_init();
       	curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
       	curl_setopt($ch, CURLOPT_URL, $rpcurl);
       	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
       	curl_setopt($ch, CURLOPT_TIMEOUT, 1);
       	curl_exec($ch);
       	curl_close($ch);
       	return true;
       }
       ```
   
 * It Does not Working in my domain, but it works on the other domain!!!!
    in both
   of domains, I was Enabled The XML-RPC option on the settings menu! so what is
   my problem?!

The topic ‘XML-RPC php function With Custom Fields Not Working!’ is closed to new
replies.

## Tags

 * [custom fields](https://wordpress.org/support/topic-tag/custom-fields/)
 * [XML-RPC](https://wordpress.org/support/topic-tag/xml-rpc/)
 * [xmlrpc](https://wordpress.org/support/topic-tag/xmlrpc/)

 * 0 replies
 * 1 participant
 * Last reply from: [pcmehrdad](https://wordpress.org/support/users/pcmehrdad/)
 * Last activity: [16 years, 3 months ago](https://wordpress.org/support/topic/xml-rpc-php-function-with-custom-fields-not-working/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
