Support

Account

Home Forums ACF PRO How can I disable for selecting "non-public" posts from lists in relation field? Reply To: How can I disable for selecting "non-public" posts from lists in relation field?

  • Hi @jonathan

    Thanks again!

    Yes! the way you suggested is much smarter and less code than mine!

    Mine worked because of css “pointer-events : none;” applied for li.cannotselect.
    But “pointer-events” works only newer browsers.
    So “e.preventDefault()” is definitely better.

    Actually, I tried these below at first and failed…
    Then I gave up using “e.preventDefault()” for this case.

    
    		$('li.cannotselect').on('click', function(e){
    			e.preventDefault();
    			return false;
    		});
    

    Also, I wanted to know if it’s possible to sort this out without using “setTimeout()”,
    but you use “setTimeout()” too.
    So I felt relieved in a sense 😉

    Anyway, thank you a lot!
    Much love from me and heaven above!