WordPress.org

Ready to get started?Download WordPress

Forums

Bypassing Media File links to their Attachment page (2 posts)

  1. Tk808
    Member
    Posted 8 months ago #

    Is their anyways to bypass files that are already linked on pages and have them open their attachment page instead?

    Need a function or call to bypass all direct media file links and have them open their respected attachment pages

  2. Tk808
    Member
    Posted 8 months ago #

    Update for this - I have found wordpress codex resource to assist with this problem, but it has not been completely solved.

    Function for direct media file links falls under " Wp_Get_... "
    That can be found in WP-Includes/post-template.php

    http://codex.wordpress.org/Function_Reference/wp_get_attachment_url

    and
    Functions for attachment page files falls under just " Get_...
    Which can be found in WP-Includes/link-template.php

    http://codex.wordpress.org/Function_Reference/get_attachment_link

    Basically, you are going to force attachment pages on the media file links.

    I'll update this post as i continue to solve the problem.

Reply

You must log in to post.

About this Topic