为什么此插件不适用于媒体上传页面?
-
-
我一到家就去看看I'll take alook as soon as i get home
- 0
- 2012-06-17
- Bainternet
-
我想这与附件设置为post_status继承这一事实有关.I guess it has to do with the fact that attachments are set post_status inherited.
- 1
- 2012-06-19
- Bainternet
-
我猜也是一样.也许wp_update_post更新附件的方式有所不同.如果我直接更新帖子表中的状态,可能会不好吗?I guess the same. Maybe wp_update_post updates attachments differently. Anything might be bad if I update status in post table directly?
- 0
- 2012-06-19
- Jenny
-
@Bainternet,我更改了创建切换链接的脚本,使用$ status作为函数的参数,并添加了"inherit"作为切换用例之一.@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.
- 0
- 2012-06-19
- Jenny
-
1 个回答
- 投票数
-
- 2012-06-19
我想我找到了答案-wp-include/post.php:
if ( ! in_array( $post_status, array( 'inherit', 'private' ) ) ) $post_status = 'inherit';
因此,无论状态如何,都将保存为"继承".
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".
我发现此插件非常有用 ajaxed-status 一个> 它是为帖子和页面创建的,我想将其应用于媒体库.所以我注释了
if (is_admin() /*&& ($pagenow=='edit.php' )*/)
这一行,并添加了以下内容:然后,我在"媒体库"列表页面上看到"状态"列,然后单击状态将其更改为新状态.但是,更改无法保存.从Firebug,我可以看到Ajax响应是正确的.我希望原始作者@Bainternet或其他人可以帮助您解决这一问题.
更新
我尝试使用update_post_meta将$ status保存为meta.有用.只是无法通过wp_update_post将其另存为post_status.