ACF Link field shows title and link on dropdown (opened)

Forums › Forums › Search & Filter Pro › ACF Link field shows title and link on dropdown (opened)

Viewing 8 posts – 1 through 8 (of 8 total)
  • Anonymous
    #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
    #273576
    This reply has been marked as private.
    Anonymous
    #273585

    Hi 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.

    Trevor
    #273612

    What type of ACF field is this? This setting in the ACF Field Group:

    https://www.screencast.com/t/YD0jUsfdFBHK

    Anonymous
    #273621

    Hi 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,

    Trevor
    #273624

    Ah, that is why it shows all the parts. It is not a field type we explicitly support, so your solution is probably a good one.

    Anonymous
    #273675

    Ok!

    Perfect.

    Thank you so much,

    Best

    Trevor
    #273677

    Thanks for getting back to me. I will close this thread for now.

Viewing 8 posts – 1 through 8 (of 8 total)

Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.