[resolved] Access to WordPress 3.5 through XML-RPC API (4 posts)

  1. elhui2
    Posted 2 years ago #


    This is my first post in this forum :D

    I need access to http://calaveradigital.com/xmlrpc.php, 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/domain.com/xmlrpc.php');
    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

  2. Pioneer Web Design
    Posted 2 years ago #

    We do not host these 'manuals'

  3. elhui2
    Posted 2 years ago #

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

    'nanual' = tutorial or 'how to' ... xD

  4. elhui2
    Posted 2 years ago #

    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);


Topic Closed

This topic has been closed to new replies.

About this Topic