WordPress.org

Forums

WP Document Revisions
Get local file path (1 post)

  1. tomdxw
    Member
    Posted 1 year ago #

    Hi,

    I'm trying to get the path to the file when I have the ID. This is what I'm doing:

    $rev_id = Document_Revisions::$instance->get_latest_revision($id);
    $rev_post = get_post($rev_id);
    $revision = get_post($rev_post->post_content);
    $filepath = get_attached_file($revision->ID);

    $filepath is then something like this (and the file does not exist):

    /var/vhosts/wordpress/wp-content/uploads/sites/2/2014/03/d41d8cd98f00b204e9800998ecf8427e.pdf

    While the actual file is at:

    /var/vhosts/wordpress/wp-content/uploads/sites/2/2014/03/test-file.pdf

    Can you help?

    Thanks,
    Tom Adams
    dxw

    https://wordpress.org/plugins/wp-document-revisions/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.