Created
January 10, 2013 18:57
-
-
Save reinier/4504773 to your computer and use it in GitHub Desktop.
If the incoming post through xml-rpc contains a custom field 'URL', set the post format to 'link'.
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 | |
// Add to functions.php | |
add_action('save_post', 'rei_xmlrpc_process_post'); | |
function rei_xmlrpc_process_post($post_id) | |
{ | |
if (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) | |
{ | |
$post = get_post_custom($post_id); | |
if(!empty($post['URL'])) | |
{ | |
set_post_format($post_id,'link'); | |
} | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment