title: wordpress: get all post embedded images
body: <p>I want to get a post embedded images but the only methods I see over the internet are</p>
  <pre><code>        $attachments = get_posts(array(
              'post_parent'       =&gt; get_the_ID(),
              'post_type'         =&gt; 'attachment',
              'posts_per_page'    =&gt; $n,
              'post_mime_type' =&gt; 'image'
          ));
  
  
          $attachments = get_children(array(
              'post_parent'       =&gt; get_the_ID(),
              'post_type'         =&gt; 'attachment',
              'posts_per_page'    =&gt; $n,
              'post_mime_type' =&gt; 'image'
          ));
  
          $attachments = get_attached_media('image', get_the_ID());
  </code></pre>
  <p>but this gives only the attached images I want all the images in a post even if they are not attached to that post <code>'post_parent' =&gt; get_the_ID()</code></p>
  <p>I think this is the WordPress way of attaching images it sounds like a one-to-many relationship
  an image can only be attached to one post</p>
  <p>any idea? thanks in advance</p>