以下のコードは、投稿に「添付」された画像の配列を返します...
$args = array(
'post_type' => 'attachment',
'numberposts' => -1,
'post_status' => null,
'post_parent' => 0
);
$excludeImages = get_posts($args);
//var_dump
var_dump ($excludeImages)
//yields (配列の最初の 5 項目のスニペット)
array(5){[0]=> object(stdClass)#194 (24)
{["ID"]=> int(46)
["guid"]=> string(59) "http://localhost/mysite/wp-content/uploads/avatar.png"}
質問: パターンが常に ["guid"]=> string(int) "path-to-image" である特定の配列項目から画像ファイル名 (この場合は avatar.png) を抽出するにはどうすればよいですか?