Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 29th, 2012  |  syntax: None  |  size: 0.46 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. PHP XML-RPC Multisite getposts
  2. require 'class-IXR.php';
  3. $ address = "http://localhost/ ~ wordpress1 / xmlrpc.php";
  4. $ q = new IXR_Client ($ address);
  5. if ($ q-> query ('wp.getPosts', 1,' admin ', '1234qwer')) {
  6. echo $ q-> getErrorCode (). ':'. $ q-> getErrorMessage ();
  7. }
  8. $d = $q-> getResponse ();
  9. //print_r ($ q-> getResponse ());
  10.  
  11. $ new = array ();
  12. foreach ($ d as $ t)
  13. {
  14. //print_r ($ t);
  15. $ new [] = array ('name' => $ t ['post_name'], 'id' => $ t ['post_id']);
  16. }