PHP WordPress - Get All Image URLS from Media Library

<?php $image_ids = get_posts( array( 'post_type' => 'attachment', 'post_mime_type' => 'image', 'post_status' => 'inherit', 'posts_per_page' => - 1, 'fields' => 'ids', ) ); $images = array_map( "wp_get_attachment_url", $image_ids );

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.