示例帖子应该是内容。
Samplepost{IFTTImageFetch=“”https://drscdn.500px.org/photo/132307433/m%3D900/4c2b5e1f7f8c4d4a11a56f8f3cfdc565“}一些东西..asd asd asd
function getImageUrlOutOfContent($content)
{
preg_match_all(\'/\\\\{IFTTTImageFetch="([^"]+)"\\\\}/i\', $content, $matches);
$url = $matches[1][0];
importRemoteMedia($url, $post->ID);
$content = str_replace($url, "", $content);
return $content;
}
add_filter(\'content_save_pre\', \'getImageUrlOutOfContent\', 10, 1);
它应该解析前缀和url-进行下载。。。并将其从内容中删除。。。但它甚至没有显示匹配。。。