• The Downloads Attachment plugin by dfactory apparently has an unpatched security vulnerability. The plugin author seems to have abandoned it. Are there any alternatives out there that work in the same way? I need something where all attachments can be added to a single page. I am not sure if there is anything suitable.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Can you elaborate more on what the plugin did or what you want it to do for you?

    Thread Starter thevp1

    (@thevp1)

    Yes, at the moment there is a downloads page with archived village magazines. These are listed with the name of the individual magazine along with a short description. There are 149 downloads in all and you can see and click on a list of 5 at a time. Using left/right clickable button to move to the next set of 5. But you stay on the same page all of the time.

    I would give you a link but the plugin has been deactivated so there is nothing to see at the moment.

    To upload attachments you simply click on “edit page” as you would normally to edit a WordPress page. Scroll down past the intro text and then there is an option to add another attachment. It is a very simple but effective system. As of yet I have found nothing comparable.

    I am not aware of a similar plugin, but hopefully the code below can work temporarily.

    In your theme functions.php file add:

    function display_attachments_shortcode( $atts ) {
        $atts = shortcode_atts( array(
            'ids' => '',
        ), $atts, 'display_attachments' );
     
        $attachment_ids = explode( ',', $atts['ids'] );
        $attachments = get_posts( array(
            'post_type' => 'attachment',
            'post__in' => $attachment_ids,
        ) );
     
        if ( empty( $attachments ) ) {
            return;
        }
     
        $output = '<ul class="attachment-list">';
     
        foreach ( $attachments as $attachment ) {
            $title = $attachment->post_title;
            $description = $attachment->post_content;
            $url = wp_get_attachment_url( $attachment->ID );
     
            $output .= '<li class="attachment-item">';
            $output .= '<a href="' . $url . '" target="_blank">' . $title . '</a>';
            $output .= '<p>' . $description . '</p>';
            $output .= '</li>';
        }
     
        $output .= '</ul>';
     
        return $output;
    }
    add_shortcode( 'display_attachments', 'display_attachments_shortcode' );

    You can then use a shortcode by adding the ids attribute and specifying the attachment IDs you want to display. For example, if you want to display attachments with IDs 123 and 456, you would use the following shortcode:

    [display_attachments ids="123,456"]

    The code will list the attachment by displaying the Title (this links direct to the file) and below it the description of the attachment.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Downloads Attachment Plugin Alternative?’ is closed to new replies.