Php 创建自定义段塞
嘿,所以现在当我发布到WordPress(自动)时,我使用的是这样的东西Php 创建自定义段塞,php,wordpress,Php,Wordpress,嘿,所以现在当我发布到WordPress(自动)时,我使用的是这样的东西 $content = '<iframe width="100%" height="315" src="https://www.youtube.com/embed/'.$row['vid_code'].'?vq=hd1080&modestbranding=1&autoplay=1&controls=1&iv_load_policy=3&loop=1&rel=0&s
$content = '<iframe width="100%" height="315" src="https://www.youtube.com/embed/'.$row['vid_code'].'?vq=hd1080&modestbranding=1&autoplay=1&controls=1&iv_load_policy=3&loop=1&rel=0&showinfo=0&color=white&autohide=0&disablekb=1" frameborder="0" allowfullscreen></iframe>';
// Create post object
$my_post = array(
'post_title' => wp_strip_all_tags( trim( $row['title'] ) ),
'post_content' => $content,
'post_status' => 'publish',
'post_author' => 1,
'post_category' => array( 3 ),
'post_date' => date('Y-m-d H:i:s')
);
$content='';
//创建post对象
$my_post=数组(
“post_title”=>wp_strip_all_标签(trim($row['title')),
“发布内容”=>$content,
“发布状态”=>“发布”,
“后作者”=>1,
“post_类别”=>数组(3),
“发布日期”=>日期('Y-m-d H:i:s')
);
现在我想知道我需要添加什么才能获得”$行['video'].
我的部分代码将成为我的网站自定义slug 好问题
尝试将其添加到代码中,它应该会返回您想要的内容。
$new_url=sanitize_title('.$row['vid_code'].')代码>
下面是这样的
$content = '<iframe width="100%" height="315" src="https://www.youtube.com/embed/'.$row['vid_code'].'?vq=hd1080&modestbranding=1&autoplay=1&controls=1&iv_load_policy=3&loop=1&rel=0&showinfo=0&color=white&autohide=0&disablekb=1" frameborder="0" allowfullscreen></iframe>';
// Create post object
$my_post = array(
'post_title' => wp_strip_all_tags( trim( $row['title'] ) ),
'post_content' => $content,
'post_status' => 'publish',
'post_author' => 1,
'post_category' => array( 3 ),
'post_date' => date('Y-m-d H:i:s')
);
$new_url = sanitize_title(''.$row['vid_code'].'');
$content='';
//创建post对象
$my_post=数组(
“post_title”=>wp_strip_all_标签(trim($row['title')),
“发布内容”=>$content,
“发布状态”=>“发布”,
“后作者”=>1,
“post_类别”=>数组(3),
“发布日期”=>日期('Y-m-d H:i:s')
);
$new_url=sanitize_title('.$row['vid_code'].');