Created
November 14, 2014 00:26
-
-
Save psorensen/ee79f92344deaeeccee6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('pmxi_attachment_uploaded', 'my_attachment_uploaded', 10, 3); | |
function my_attachment_uploaded($pid, $attid, $filepath){ | |
$attachment = get_post($attid); | |
// do something with $attachment file | |
if (get_post($pid) == 'industry-resource') { | |
wp_update_post(array('ID' => $attid, 'guid' => str_replace('uploads/', 'uploads/indres/', $filepath))); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment