Support

Account

Home Forums General Issues If get_fields is empty not working Reply To: If get_fields is empty not working

  • yeah this is not the output but it takes tu arguments here:

    public function getQueryArray($params){
    		$query_array = array(
    			'post_status'    => 'publish',
    			'post_type'      => 'show-item',
    			'posts_per_page' => $params['number_of_items'],
    			'orderby'        => $params['orderby'],
    			'order'          => $params['order']
    		);
    		
    		$field = get_field('date_de_debut');
    		if (!empty ($field)) {
    			$query_array['meta_key'] = 'date_de_debut';
    			$query_array['orderby'] = 'meta_value';
    }

    So there is probably a solution there !