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 | |
// Do not include the opening php tag. | |
// Populate image title, alt-text, caption, and description on upload | |
// but only if upload is via XML-RPC (thanks Colin Walker) | |
add_action ('xmlrpc_call', 'check_new_attachment' ); | |
function check_new_attachment( $method ) { | |
if( 'metaWeblog.newMediaObject' === $method ) { | |
add_action( 'add_attachment', 'crt_set_image_meta' ); |