WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm creating a page that is pulling info from Vimeo using oEmbed. Everything works fine but the multiple calls to vimeo are causing page load issues (obviously).

I was wondering if it would be possible to make the same oEmbed call when the post is being created/saved, then populating various post meta variables with the information.

share|improve this question
up vote 1 down vote accepted

Yes, most definitely. Take this skeleton code below as a base for a function that would do what you want, and place it in your functions.php:

function your_vimeo_meta_function ($post_id) {

    // some verifications first
    if ( $post_id == null || empty($_POST) )

    if ( !isset( $_POST['post_type'] ) || $_POST['post_type']!='post' )  

    if ( wp_is_post_revision( $post_id ) )
        $post_id = wp_is_post_revision( $post_id );

    global $post;  
    if ( empty( $post ) )
        $post = get_post($post_id);

     * do your vimeo stuff here 

    update_post_meta($post_id, 'your_vimeo_key_name', $your_vimeo_value);
    // if this key doesn't exist, it will be created. If it exists, it will be updated
add_action('save_post', 'your_vimeo_meta_function', 12 );
share|improve this answer
Awesome. This works, I'm able to use it to populate the post meta key with arbitrary data. Unfortunately, for some reason, it wont accept me saving data directly from the XML. I'll need to look into that as I'm sure it's an unrelated problem. – George Kendros Oct 3 '12 at 3:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.