add_action('admin_menu', function () { add_management_page( 'Exportar URLs de Imagens', 'Exportar URLs de Imagens', 'upload_files', 'exportar-urls-imagens', 'exportar_urls_imagens_page' ); }); function exportar_urls_imagens_page() { if (!current_user_can('upload_files')) { return; } $ids = get_posts([ 'post_type' => 'attachment', 'post_mime_type' => 'image', 'post_status' => 'inherit', 'posts_per_page' => -1, 'fields' => 'ids', 'orderby' => 'ID', 'order' => 'ASC', ]); $urls = []; foreach ($ids as $id) { $url = wp_get_attachment_url($id); if ($url) { $urls[] = $url; } } echo '

URLs de todas as imagens

'; echo '

Total de imagens: ' . count($urls) . '

'; echo ''; echo '

'; echo '
'; }

Hello world!

Escrito por

em

Welcome to WordPress. This is your first post. Edit or delete it, then start writing!

Comentários

Uma resposta para “Hello world!”

  1. Avatar de A WordPress Commenter

    Hi, this is a comment.
    To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.
    Commenter avatars come from Gravatar.

Deixe um comentário

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *