Forums › Forums › Search & Filter Pro › ACF Link field shows title and link on dropdown (opened)
- This topic has 7 replies, 2 voices, and was last updated 5 years, 2 months ago by
Trevor.
-
Anonymous(Private) January 22, 2021 at 8:55 am #273575
Hi,
Following closed topic: https://support.searchandfilter.com/forums/topic/acf-link-field-shows-title-and-link-on-dropdown/#post-273222
The first time, as I commented on previous post, I could remove the “no-title” options, but if I open the dropdown again, other options are showed… I understand this is no correct way to do this.
Could you help me, please?
Access on next private post.
Thanks!
Best,
Anonymous(Private) January 22, 2021 at 9:48 am #273585Hi again,
I’m using this:
$(document).ready(function() {
$(“[name=’_sfm_post_project[]’] option[value^=’http'”).remove();
$(“[name=’_sfm_post_project[]’] option[value=’_blank”).remove();
$(“[name=’_sfm_post_project[]’] option[value=’#'”).remove();});
(function ( $ ) {
“use strict”;
$(document).on(“sf:ajaxfinish”, “.searchandfilter”, function(){
$(“[name=’_sfm_post_project[]’] option[value^=’http'”).remove();
$(“[name=’_sfm_post_project[]’] option[value=’_blank”).remove();
$(“[name=’_sfm_post_project[]’] option[value=’#'”).remove();
});
}(jQuery));And now it works fine … but I wonder if there is another more “elegant” way to do it.
Thanks again.
Anonymous(Private) January 22, 2021 at 12:27 pm #273621Hi Trevor,
I’m using a ACF ‘Link’ field (as Array).
I need to select an internal or external link (with ‘target’ attribute) depending on the case.
Dropdown lists all array values from field: title, url, and target.
I only need to show the title.Thanks,
-
AuthorPosts