WordPress‘s Pages open the door to using WP as a content management system. Unfortunately, Pages can’t be edited via XML-RPC blogging apps like Ecto. This might be a good thing, but I’m foolhardy enough to try working around it.
Here’s how:
Find a text editor you like and open up the wp-includes/functions-post.php file.
in the wp_get_recent_posts() function, change this:
$sql = “SELECT * FROM $wpdb->posts WHERE post_status IN ('publish', 'draft', 'private') ORDER BY post_date DESC $limit”;
to this:
$sql = “SELECT * FROM $wpdb->posts WHERE post_status IN ('publish', 'draft', 'private', 'static') ORDER BY post_date DESC $limit”;
Now, in the wp_update_post() function, look for this block of code:
// Escape data pulled from DB.
$post = add_magic_quotes($post);
extract($post);
and insert this block underneath it:
// XML-RPCs apps can't return “static” post status,
// so we have to work around it
$page_status = NULL;
if($post_status == “static”)
$page_status = “static”;
And follow that up by looking for this block:
// Now overwrite any changed values being passed in. These are
// already escaped.
extract($postarr);
and insert this block underneath it:
// set post_status static if this is a page
if($page_status)
$post_status = $page_status;
Fair warning: this works in my limited testing, but don’t blame me if you try it and it breaks something. You’d be a fool to mess with this on a live install, so don’t.
tags: blog, blogg as cms, blogg as content management system, blogging, cms, content management system, ecto, hack, hacking, hacking wordpress, php code, wordpress, wordpress hack, wordpress hacks, wordpress pages, xml rpc, xmlrpc