Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Add arbitrary custom fields to imported Instagram posts.
<?php
function dsgnwrks_instagram_save_postmeta_fields( $post_id, $instagram_photo_object, $post_args, $user_settings ) {
$excerpted_caption = substr( $instagram_photo_object->caption->text, 0, 100 );
update_post_meta( $post_id, 'excerpted_caption', $excerpted_caption );
}
add_action( 'dsgnwrks_instagram_post_save', 'dsgnwrks_instagram_save_postmeta_fields', 4 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.