• Hi,

    First time poster long time reader…

    I have the code below that I am using to get posts with a post_type=”vehicle”. I have no idea how to use filter as the docs on wordpress are not very clear in giving examples for requests but is good for giving responses, go figure.

    Please could someone explain how to use filter and set a post_type?

    Also could someone explain what blog_id is as it cant see a ref to it in the DB tables and when I change the value its doesn’t seem to change anything but fails without?

    $rpc = new IXR_Client( "http://localhost/wordpress/xmlrpc.php" );
    $status = $rpc->query(
        "wp.getPosts", // method name
        "1", // blog id
        "admin", // username
        "test1234" // password
    );
    
    if( !$status )
    {
        print "Error ( " . $rpc->getErrorCode() . " ) : ";
        print $rpc->getErrorMessage() . "\n";
        exit;
    }
    
    $response = $rpc->getResponse();
    
    print("<pre>" . print_r($response, true). "</pre>");

    Thanks

  • The topic ‘XMLRPC wp.getPosts: How do I use filter?’ is closed to new replies.