I’m currently trying to implent a new custom column at the page manage screen that will let me change the status (published/pending) of the different pages via an easy toggle link.
From what I’ve gathered I need to use $post->post_status, ‘status‘in someway, probably toggle with jQuery or something. But I can’t figure out how I tie it together with ajax. Thought I’d get some help looking at the default post status modifier in the edit post screen, but I realized that it’s not ajax based, I the status updates when you press “update” (obviously, duh).
Here’s my lousy try for an attempt so far:
function wp_change_page_status_link() {
$status = get_post_status($ID);
if($status == 'publish'){
$status = '<span>On</span>';
//$post->post_status, 'pending'
}
elseif($status == 'pending'){
$status = '<span>Off</span>';
}
return $status;
}
Would be really grateful if someone could point me in the right direction..
here you go: