Support » Plugins » AutoComplete search custom fields, almost there!

  • Hello everyone! I’m hoping someone can help me get this little piece of code to return values stored in my custom field table. I tried a few different things from this page, but I couldn’t get anything to work! I was hoping it would be ask easy as adding $wpdb->postmeta, but no luck. The auto-complete script is from CSS Jockey.

    <script type="text/javascript">
    	$(document).ready(function(){
    
    	var data = '<?php global $wpdb; $search_tags = $wpdb->get_results("SELECT name FROM $wpdb->terms"); foreach ($search_tags as $mytag){ echo $mytag->name. " "; } ?>'.split(" ");
    
    	$("#s").autocomplete(data);
    
    	})
    	</script>
  • The topic ‘AutoComplete search custom fields, almost there!’ is closed to new replies.