TransWikia.com

how to fetch entries with custom field data matches or else that field is empty

Craft CMS Asked by Mahantesh Teli on August 1, 2021

$queryElement = Entry::find()
    ->section('posts')
    ->country(['abc', ':empty:'])
    ->location(['xyz', ':empty:'])
    ->orderBy('postDate desc')
    ->limit(null);

here country, location are custom fields added to the section
this code will return empty array when executed

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP