• I am working on a custom post type that will be used with my IceCast internet radio server to schedule audio files (podcasts mainly) to be fed into the radio server. The files are being uploaded as attachments and the exact length of the MP3s (in seconds) is available via WordPress as meta data. The actual schedule will be set up as a custom post type named ‘radio_schedule’, and within that post type will be a custom field that will hold the timestamp for when that MP3 should “theoretically” be played.

    So lets say I already have one MP3 scheduled for 1:00 PM Eastern…

    When I create the second ‘radio_schedule’ post, the “time to play” field should populate with a timestamp equal to the first posts “1:00 PM Eastern” timestamp plus that file’s duration in seconds (so if the first file is 1h25m in length, the second post’s “time to play” field would be 2:25 PM Eastern”.

    I have looked around and couldn’t find much information regarding hooks/filters/actions that take effect when I go to create a new post other than using add_action with ‘admin_print_scripts-post-new.php’, but i am having trouble figuring out how to get the PHP code to then force the proper custom field to populate.

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

    (@macharborguy)

    i think i may have answered my own question without realizing it (amazing what 2 beers can do to a persons thought process)…

    since i am hooking to “admin_print_scripts-post-new.php”, i can use the PHP code to pull the proper date information, then I just generate a javascript block that inserts the data.

Viewing 1 replies (of 1 total)

The topic ‘Pre-fill post with previous posts information’ is closed to new replies.