• I’m trying to access the ‘Last-Modified’ meta data for a file, however I haven’t managed to get it working inside of WordPress.

    Outside of WordPress, this works fine:

    $remoteheaders = get_headers($url, 1);
    echo $remoteheaders['Last-Modified'];

    However, that function won’t run inside the WP API. I’ve seen that there are two WP functions, wp_get_http and wp_get_http_headers, but i haven’t gotten either to work.

    Can anyone provide a working example to doing this?

Viewing 1 replies (of 1 total)
  • Thread Starter jweikelinteractive

    (@jweikelinteractive)

    Nevermind, solved the issue. When working inside the wordpress api, use all lowercase letters. For example, ‘Last-Modified’ would be ‘last-modified’.

Viewing 1 replies (of 1 total)
  • The topic ‘Using get_headers in WordPress’ is closed to new replies.