Jump to content

Is this the right codes to use? Timestamp media


Recommended Posts

Hi, I've been trying to find a tutorial that will tell me how to add a timestamp (Last updated: date and time) of a mp3 audio link or next tot he link in wordpress. I'm using "link to media file" type of audio link. The files are often overwritten so the timestamp needs to date each time the file replaced by our overwrite plugin.  Anyways, while looking for tutorials I found  https://developer.wordpress.org/reference/functions/wp_get_media_creation_timestamp/  but it really doesn't explain must to the reader. If this article suppose to tell me how to do something? If so, I sure can't figure out what. I have no probably editing the php files if I can find a tutorial but on this subject I can't. 

Thank you for your time
Kimberly

 

Link to post
Share on other sites

That's not a tutorial, it is a reference page. References provide technical details about a function for somebody who already knows how to use functions. The reference expects your code to have access to a getID3 object, which does not appear in the reference manual, so it probably is an external resource.

If you just want to know when a file was modified, PHP has a built in function filemtime() which returns a UNIX timestamp. the date() function can turn the UNIX timestamp into a meaningful string.

  • Thanks 1
Link to post
Share on other sites
21 hours ago, Ingolme said:

That's not a tutorial, it is a reference page. References provide technical details about a function for somebody who already knows how to use functions. The reference expects your code to have access to a getID3 object, which does not appear in the reference manual, so it probably is an external resource.

If you just want to know when a file was modified, PHP has a built in function filemtime() which returns a UNIX timestamp. the date() function can turn the UNIX timestamp into a meaningful string.

Thanks, I will look at these links.  I'm also looking at timeStamp Event Property to see if it can be used to create a Last Updated: Date and Time using html codes. 

The links before rebuilding the website are:  (Last update on this website was 2015) 
The links come from a folder outside of wordpress. I have a plugin that can forward all mp3 to another folder in the same cpanel.

<a href="http://sitename.com/programs/news011.mp3?ver=2.0">News011.mp3</a>

File Link: News011.mp3
Last Updated:Tue Jun 16, 2020 03:06:17 pm

I can't figure out what this ?ver="2.0 means and thought maybe it a html code.  I 

Sorry for the rambling. I'm really want to learn this so if there is an future issue with this, I can understand it. It a new client. 

Thanks for listening
Kimberly

 

 

Link to post
Share on other sites

If you are loading the file from another website, you have no way to know when it was last modified. To find out the modification time of a file, it has to be on your server.

The ?ver=2.0 probably is just there so that older versions of the file are not loaded from the browser cache.

  • Thanks 1
Link to post
Share on other sites
19 minutes ago, Ingolme said:

If you are loading the file from another website, you have no way to know when it was last modified. To find out the modification time of a file, it has to be on your server.

The ?ver=2.0 probably is just there so that older versions of the file are not loaded from the browser cache.

Thank you for your time, I can put the file any place I want it.  

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...