Last active
August 29, 2015 14:12
-
-
Save traversal/ed1eb9a033a51e44b35d to your computer and use it in GitHub Desktop.
Edit attachment
This file contains 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
<?php | |
function my_update_media($object_id, $object_type) { | |
global $wf; | |
if ($object_type == "post") { | |
$post = $wf->post($object_id); | |
if ($post->is_an("attachment")) { | |
update_post_meta($object_id, "details.field", "update!!" . $object_id . time()); | |
} | |
} | |
} | |
add_action("mp_after_save_meta", "my_update_media", 100, 2); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment