run function on new post (2 posts)

  1. criuz
    Posted 5 years ago #


    I am quite new to tweaking/hacking wordpress to suite my needs, so please be patient with me.

    Here's the scenarion: I installed ffmpeg on the box where I run wordpress from. In my wordpress installation I created a custom post type called videos. Now I'd like to run ffmpeg and create a thumbnail everytime I create a new "videopost". Since ffmpeg-php doesn't work as expected I'd run ffmpeg via exec();.

    Now my main question is: How could I run the exec(ffmpeg); function everytime a new post in the custom post type is created?

    Kind regards,

  2. s_ha_dum
    Posted 5 years ago #

    Use one or more of the post actions hooks, probably save_post but play with it to see what works best. You'd do this:

    function my_ffmpeg_func($ID) {
    // some code

Topic Closed

This topic has been closed to new replies.

About this Topic