Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.


update

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
1  
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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.