I needed it too, and i wrote the class for it in my local. @maartenm perhaps you can include it in a next update?
in includes/conditions i’ve adde dthe file class-wdc-post_author-condition.php
<?php defined( 'ABSPATH' ) or exit; // Exit when accessed directly.
/**
* Post type condition
*/
class WDC_Post_Author_Condition extends WDC_Condition
{
/**
* Constructor
*/
public function __construct()
{
parent::__construct( 'post_author', __( 'Post Author', 'wdc' ), array
(
'operators' => array( '==', '!=' ),
'category' => 'post',
'order' => 10,
));
}
/**
* Values
*
* @param array $choices
*
* @return array
*/
public function values( $choices )
{
$authors = get_users();
$values = array();
foreach ( $authors as $author )
{
$values[ $author->ID ] = $author->user_nicename;
}
return $values;
}
/**
* Apply
*
* @param bool $return
* @param string $operator
* @param mixed $value
*
* @return bool
*/
public function apply( $return, $operator, $value )
{
global $post;
return wdc_do_operator( $operator, (!empty($post) && $post->post_author == $value ), true );
}
}
wdc_register_condition( 'WDC_Post_Author_Condition' );
and in widget-display-conditions.php i’ve added
include_once WDC_ABSPATH . 'includes/conditions/class-wdc-page-condition.php';
to the wdc_init() function.
this works for me