WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I found this plugin very useful ajaxed-status It was created for post and page, and I want to apply it on media library. so I commented out the line if (is_admin() /*&& ($pagenow=='edit.php' )*/) and added this:

add_filter ( "manage_upload_columns", array ($this, 'add_new_columns' ) );
add_action ( "manage_media_custom_column", array ($this, 'manage_columns' ), 0, 2 );

Then, I got the status column on Media Library list page, and I can click the status to make it change to new status. But, the change can't be saved. From Firebug, I can see the ajax response is correct. I hope the original author, @Bainternet , or other people, may help figure this out.


I tried update_post_meta to save the $status as meta. It works. Just can't save it as post_status by wp_update_post.

share|improve this question
I'll take alook as soon as i get home – Bainternet Jun 17 '12 at 16:32
I guess it has to do with the fact that attachments are set post_status inherited. – Bainternet Jun 19 '12 at 13:10
I guess the same. Maybe wp_update_post updates attachments differently. Anything might be bad if I update status in post table directly? – Jenny Jun 19 '12 at 13:40
@Bainternet , I changed the scripts that created the toggle links, I use $status as an argument of the function and added "inherit" as one of the switch cases. – Jenny Jun 19 '12 at 14:13
up vote 2 down vote accepted

I think I find the answer-- wp-include/post.php:

if ( ! in_array( $post_status, array( 'inherit', 'private' ) ) )
    $post_status = 'inherit';

So, whatever status will be saved as "inherit".

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.