Forums

[xmlrpc] How to get posts with offset? (6 posts)

  1. themcme
    Member
    Posted 2 years ago #

    Hello,

    I use xmlrpc with Java to get my posts.
    I would like to be able to do a pagination (like 10 posts by page), but with xmlrpc the only method available is mw_getRecentPosts().
    I need a method which accepts an offset parameter, and a method which returns the count of all my posts.

    How I can do?
    Do I have to implement that by myself?

    Thanks!

  2. Joseph Scott
    Member
    Posted 2 years ago #

    The existing XML-RPC APIs don't really provide a way for collecting all of the post data right now.

  3. themcme
    Member
    Posted 2 years ago #

    Thanks.
    That sucks ;-)
    I didn't want to update the WP code to be able to upgrade it easily, but I think I will have to...

  4. Joseph Scott
    Member
    Posted 2 years ago #

    You can add new XML-RPC methods via plugins in WordPress, so it's easy to get going on something like this. That also might make it easier to get potential changes into core WP later on.

  5. themcme
    Member
    Posted 2 years ago #

    But anyway I also have to modify xmlrpc.php right?

  6. Joseph Scott
    Member
    Posted 2 years ago #

    Nope, you can add XML-RPC methods via the 'xmlrpc_methods' filter. This makes it possible to add new methods entirely from within a plugin.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags