Support

Account

Forum Replies Created

  • Oh thanks for that note, i was wondering before why I have to check on existence anyway yet now I understand as you pointed out that this is related to me working with wpcli created posts. Then I should set the field values explicitly to a value anyway when working with wpcli in order to have things consistent in the database. Thanks again

  • Thanks again for keep supporting me here, particular as this is clearly a wp issue as I understand now.

    Since I had to come up with a quick solution I just decided to go for the following workaround:

    When I import a new image I set the value of the image field explicitly to ”. (Which is very doable in my case as I create all posts via wpcli …)

    Since there is no need anymore to check for cases of non existent image fields I just query as follows (which is the complete query as i use it in my actual program, including only an additional paged parameter)

    $wp_query = new WP_Query( array(
    	'post_type'      => 'post',
    	'posts_per_page' => 15,
    	'paged'          => $paged,
    	'meta_key' => 'delight_image',
    	'meta_query' => array(
    		array(
    			'key' => 'delight_image',
    			'value' => '',
    			'compare' => '!=',
    		),
    	),
    ) );

    Luckily it now works as expected. Sorry I didn’t dig deeper into this but sometimes workarounds are just the way to go 🙂

    thanks

    maritn

  • Thanks again for the reply. Unfortunately this solution also doesnt seem to work for me. Where can i find the actual database entry to double check how the field is set? I am just off now soon so will check again tomorrow.

  • Hi John, thanks for the reply, I found that stackexchange answer too yet it doesnt seem to work for the acf image field. Question is what the acf plugin does when you remove an image from the image field in the post edit field (by pressing the cross).

  • Hi @elliot,

    thanks a lot for the quick answer.

    I just looked into the source code and made the following change in line 335 of the file select.php

    $choice = explode(':', $choice, 2);

    This seems to work for my case as it limits the split to the first ‘:’ ;

    In any case thanks for your reconsideration of the change you made and your awesome plugin.

    Best and beyond

    martin

Viewing 6 posts - 1 through 6 (of 6 total)