WordPress.org

Support

Support » Plugins and Hacks » [Plugin: Custom Content Type Manager] XMLRPC with CCTM

[Plugin: Custom Content Type Manager] XMLRPC with CCTM

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Contributor fireproofsocks
    Member

    @fireproofsocks

    Man, I really don’t know what you’re trying to do here. Where are you putting that code? Are you sure it’s supposed to be ‘type_post’ and not ‘post_type’?

    Hi,

    i am trying add a custom post with xmlrpc , can i do it?

    and, yes is post_type..

    thanks

    Plugin Contributor fireproofsocks
    Member

    @fireproofsocks

    Where are you putting that code?

    Hi,

    i have a custom type called mynews and i am trying add a post with xmlrpc.

    here is the code:

    <?
    		require("xmlrpc/class-IXR.php");
            $client = new IXR_Client('http://mysite.com/xmlrpc.php');
    
            $USER = 'user';
            $PASS = 'pass';
    
            $content['title'] = 'Test title '.mt_rand();
            $content['categories'] = array("");
    	$content['post_type'] = 'mynews';
        //  $content['custom_fields'] = array( array('key' => 'post_type','value'=>'downloadimpresa') );
            $content['description'] = '<p>Lorem ipsum dolor sit amet</p>';
    
            $content['mt_keywords'] = array('foo','bar');
    
            if (!$client->query('metaWeblog.newPost','', $USER,$PASS, $content, true))
            {
                die( 'Error while creating a new post ' . $client->getErrorCode() ." : ". $client->getErrorMessage());
            }
            $ID =  $client->getResponse();
    
            if($ID)
            {
                echo 'Post published with ID:#'.$ID;
            }
    ?>

    when i try execute this code i have an error:
    Error while creating a new post 401 : invalid post type

    Can help me?

    thanks

    Plugin Contributor fireproofsocks
    Member

    @fireproofsocks

    Sounds like it might be bug with WordPress’ implementation of xmlrpc. I presume you’re saving this code at the root of your site somewhere?

    Hi,

    no, this code isnt in root of wordpress instalation.

    thanks

    Plugin Contributor fireproofsocks
    Member

    @fireproofsocks

    To repeat myself:

    Where are you putting that code?

    Thanks. It’s impossible to offer significant feedback without detailed information.

    hi,

    i put that code in /root_wordpress/directory/test.php

    thanks

    Plugin Contributor fireproofsocks
    Member

    @fireproofsocks

    Looks like it’s a bug in WordPress : http://core.trac.wordpress.org/ticket/18429 and http://core.trac.wordpress.org/ticket/16476 Hopefully the patch will be released soon.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: Custom Content Type Manager] XMLRPC with CCTM’ is closed to new replies.