ContentLEAD/ContentLead-WP-Plugin — pull request #13 by retlehs (2013-08-22 16:13:05+00:00)
Title: Add filter for author

On shoretelsky.com we use a modified version of this plugin in order to set a random author for imported posts. By adding a filter for the author, we can use the core plugin without modifications and still have the functionality we need. Example code:

```php
function random_author() {
$randID = mt_rand(1,100);
$post_author = '1';
switch (true) {
case ($randID <= 25):
$post_author = '2';
break;
case ($randID > 25 AND $randID <= 50):
$post_author = '3';
break;
case ($randID > 50 AND $randID <= 75):
$post_author = '4';
break;
case ($randID > 75 AND $randID <= 100):
$post_author = '5';
break;
}
return $post_author;
}
add_filter('braftonxml_author', 'random_author');
```