• This plugin is great! It would be nice if it didn’t have the “auto-suggest” dropdown when “Available Tags” is not specified/blank. I just want to be able to type in any tag without the auto-suggest dropdown.

    Is this easily done, or would the plugin need to be modified?

    Thank you,
    Daniel

Viewing 2 replies - 1 through 2 (of 2 total)
  • Interesting – I was going to ask the opposite. I’m wanting the auto-suggest functionality to work (listing suggestions of past tags entered), but it’s not working for me.

    Rather than completely remove such functionality, I think it would be best as an option that one could turn on and off – so that both of us could get the functionality we needed ??

    I’m going to dig into the plugin and see if I can figure out why it’s not working for me (i.e. listing possible suggestions of tags previously entered), and maybe will find a way to offer an on/off switch in the bargain ??

    -twykr.

    Hi again –

    Okay – just noting that I ended up exporting the ACF definition to PHP code, and putting it into the child theme’s functions.php file. From there, to get the suggestions that I wanted, I manually queried out the past entries from the database, and added them to the ACF definitions myself (in the “available_tags” section). Here’s some code snippets, if it helps. NOTE: I’m using the generic field name of “acf_field” in my code – you’d want to replace that with your actual ACF field name / handle in the appropriate places… and you should *not* copy / paste the ACF PHP code itself, as that will not work:

    // Pull any previous "acf_field" values from the wp_postmeta table
    $query_acf_field = "SELECT DISTINCT meta_value FROM " . $wpdb->prefix . "postmeta WHERE meta_key = 'acf_field' ORDER BY meta_value ASC";
    $pull_acf_field  = $wpdb->get_results($query_acf_field);
    // declare the var and clear out any past information - just to be sure
    $acf_field_values = '';
    // loop through the query results, and add them to the list - each on their own line
    foreach ($pull_acf_field as $by) {
      $acf_field_values .= $by->meta_value."\n";
    }

    And you put the output from the above query in your ACF PHP definitions, like so:

    // EXAMPLE ONLY - don't copy / paste this, as it won't work. 
    // Instead, look in your ACF PHP code, and find the entry that uses "tag-it" as the "type"
    array (
    	'key' => 'field_abcdef1234567',
    	'label' => 'acf_field',
    	'name' => 'acf_field',
    	'type' => 'tag-it',
    	'instructions' => 'Add any acf_field information you wish to appear publicly',
    	'required' => 0,
    	'conditional_logic' => 0,
    	'wrapper' => array (
    		'width' => '',
    		'class' => '',
    		'id' => '',
    	),
    	'available_tags' => $acf_field_values,
    ),

    Note that you should be able to enforce no results for suggestions by simply having:

    ‘available_tags’ => ”,

    HTH,
    -twykr

    • This reply was modified 7 years, 10 months ago by twykr.
    • This reply was modified 7 years, 10 months ago by twykr.
    • This reply was modified 7 years, 10 months ago by twykr.
    • This reply was modified 7 years, 10 months ago by twykr.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Remove Auto-Suggest Drop-Down’ is closed to new replies.