Ich habe das Problem, daß über die xmlrpc.php alles einwandfrei übertragen wird, ausser der korrekten Kategorie, es wird immer alles in die Standardkategorie gepackt, egal was ich unter categories angebe.
Nachfolgend mal der Code, den ich verwende:
Code
/*
wp.newPost(blog_id, username, password, struce, publish)
http://codex.wordpress.org/XML-RPC_wp#wp.newPage
*/
require('../wp-includes/class-IXR.php');
$rpc = new IXR_Client('http://www.meineseite.de/xmlrpc.php');
// das Post construct:
// Metadaten
$post = array(
"title" => "$Title",
"description" => "$Description",
"categories" => "$Category",
"mt_keywords" => "$Tags",
"custom_fields" => array(
array( "key" => "cp_contact_name", "value" => "$Contact" ),
array( "key" => "cp_street", "value" => "$Street" ),
array( "key" => "cp_zipcode", "value" => "$Zip" ),
array( "key" => "cp_state", "value" => "$State" ),
array( "key" => "cp_city", "value" => "$Location" ),
array( "key" => "cp_phone", "value" => "$Phone" ),
array( "key" => "cp_fax", "value" => "$Fax" ),
array( "key" => "cp_contact_email", "value" => "$Email" ),
array( "key" => "cp_extern", "value" => "$Extern" ),
array( "key" => "cp_company_homepage", "value" => "$Url" )
)
);
// query
$status = $rpc->query(
'metaWeblog.newPost', // Methode
1, // Blog ID, i.d.R. 1
'admin', // Benutzer
'passwort', // Passwort
$post, // Post construct
false // Veröffentlichen?
);
// Ergebnis überprüfen und ggf. eine Fehlermeldung ausgeben
if(!$status) {
echo 'Error ('.$rpc->getErrorCode().'): '.$rpc->getErrorMessage();
exit;
}
// Sonst: ID des neuen Posts ausgeben
echo 'Neue Pressemitteilung gespeichert, ID: '.$rpc->getResponse();
Alles anzeigen
Kann mir jemand sagen, wo da der Fehler ist ?