Support » Fixing WordPress » Access to WordPress 3.5 through XML-RPC API

  • Resolved elhui2



    This is my first post in this forum 😀

    I need access to, I use php to convert the data with json_encode(array), this is my script:

    //This have a user, password
    require_once 'config.php';
    require_once '../wp-includes/class-IXR.php';
    //this is the call
    $client= new IXR_Client('http://localhost/');
    if (!$client->query('wp.getTaxonomies',$args,$user,$pass)){
        echo('Un error ha ocurrido durante la consulta:--->>>.' . $client->getErrorCode().":".$client->getErrorMessage());
    $cats = $client->getResponse();
    echo json_encode($cats);

    This response nothing :'(

    If you have a documentation or manual or something i will very happy.

    thanks and have a nice day

Viewing 3 replies - 1 through 3 (of 3 total)
  • We do not host these ‘manuals’

    ¬¬ ok sorry for that, my english is very bad! u.u

    ‘nanual’ = tutorial or ‘how to’ … xD

    This is the good script to get categories:

    require_once '../wp-includes/class-IXR.php';
    $client = new IXR_Client($url);
    $content= 'category';
    $params= array(0,$usr,$pas,$content);
        die('An error occurred - '.$client->getErrorCode().":".$client->getErrorMessage());
    header("Access-Control-Allow-Origin: {$_SERVER['HTTP_ORIGIN']}");
    header('Access-Control-Max-Age: 86400');
    header('Access-Control-Allow-Credentials: true');
    header("Access-Control-Allow-Methods: GET, POST, OPTIONS");
    header("Access-Control-Allow-Headers: {$_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']}");
    header('Cache-Control: no-cache, must-revalidate');
    header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
    header('Content-type: application/json');
    echo json_encode($respuesta);


Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Access to WordPress 3.5 through XML-RPC API’ is closed to new replies.