我正在运行YouTube Video Fetcher 插件位于。它使用youtube api获取视频并将其显示在您的网站上。
在插件脚本中,有以下顺序:
if (empty($items)) {$ret .= " \'No new videos.\'";}
else foreach ( $items as $item ) :
如果找不到“新视频”,是否可以将wordpress帖子状态从“已发布”更改为“草稿”?我认为解决方案是使用wp update post功能和以下内容:
<?php
// Update post
$my_post = array();
$my_post[\'ID\'] = $id;
$my_post[\'post_status\'] = \'draft\';
// Update the post into the database
wp_update_post( $my_post );
?>