WordPress.org

Ready to get started?Download WordPress

Forums

Custom Content Type Manager
XMLRPC with CCTM (10 posts)

  1. hussan
    Member
    Posted 1 year ago #

    Hi, how i can use xmlrpc.php with CCTM? i need add a post in my_custom_type_post.

    If i set $content['type_post'] = 'my_custom_type_post' not work.

    can help me?

    Thanks

    http://wordpress.org/extend/plugins/custom-content-type-manager/

  2. fireproofsocks
    Member
    Plugin Author

    Posted 1 year ago #

    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'?

  3. hussan
    Member
    Posted 1 year ago #

    Hi,

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

    and, yes is post_type..

    thanks

  4. fireproofsocks
    Member
    Plugin Author

    Posted 1 year ago #

    Where are you putting that code?

  5. hussan
    Member
    Posted 1 year ago #

    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

  6. fireproofsocks
    Member
    Plugin Author

    Posted 1 year ago #

    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?

  7. hussan
    Member
    Posted 1 year ago #

    Hi,

    no, this code isnt in root of wordpress instalation.

    thanks

  8. fireproofsocks
    Member
    Plugin Author

    Posted 1 year ago #

    To repeat myself:

    Where are you putting that code?

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

  9. hussan
    Member
    Posted 1 year ago #

    hi,

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

    thanks

  10. fireproofsocks
    Member
    Plugin Author

    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic