Skip to content

Instantly share code, notes, and snippets.

@polevaultweb
Last active April 11, 2016 10:16
Show Gist options
  • Save polevaultweb/b0aa58b903001b12e4945d76e824ff7a to your computer and use it in GitHub Desktop.
Save polevaultweb/b0aa58b903001b12e4945d76e824ff7a to your computer and use it in GitHub Desktop.
Using the `igp_image_filename` filter in Instagrate Pro
<?php
add_filter( 'igp_image_filename', 'my_igp_image_filename', 10, 4 );
function my_igp_image_filename( $file_name, $file, $post_name, $postid ) {
$file_name_parts = explode( '.', $file_name );
$ext = array_pop( $file_name_parts );
$file_name = 'my-prefix-' . implode( '.', $file_name_parts ) . '-'. date( 'Y-m-d' ) . '.' . $ext;
return $file_name;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment