Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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

    I would propose to fix it like this:

    Instead of:
    if(parseFloat($().jquery) >= 1.7){
    Do this:
    if(parseInt($().jquery.replace('.','')) >= 17){

    Because your solution would do: (1,1 -1)*100 = 10 which is already larger than 7. So actually the if statement for older versions does not work as expected.

    By removing dots in the version string you’re left with an int that should be increasing in number if they adher to logical version numbering.

    I have this problem today updating wpcf7 to version 3.2.1

Viewing 3 replies - 1 through 3 (of 3 total)