Change attached img anchor link to post link

You may try the filter wp_get_attachment_link // definition: apply_filters( ‘wp_get_attachment_link’, “<a href=”” . esc_url( $url ) . “”>$link_text</a>”, $id, $size, $permalink, $icon, $text, $attr ); // this filter provide a max. of 7 arguments, I use 2 in the example add_filter( ‘wp_get_attachment_link’, ‘q363693_update_attachment_link’, 10, 2 ); function q363693_update_attachment_link( $url, $id ) { // some codes … Read more

Get all post embedded images

You can use DOMDocument to get every image from any page: function testingdom(){ $dom = new DOMDocument(); libxml_use_internal_errors(true); $dom->loadHTMLFile(‘https://the_post_url.com/anyone’); $data = $dom->getElementsByTagName(“img”); $srcs = array(); foreach($data as $key => $dat){ $srcs[] = $data->item($key)->getAttribute(“src”); } $dom = null; } add_action(“wp_head”, “testingdom”); This way you should have every src in an array called srcs

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)