We’ve been looking at how to create a simple CRM system in WordPress. In the last part of this series, we added code to our plugin which allowed us to display our Advanced Custom Fields in the WordPress List Table (WP_List_Table), and sort our data alphabetically by those new fields.Today we’ll cover how to extend the search functionality to include the data stored in our Custom Fields.Search FunctionalityEach Post Type that has an Administration Interface comes with a search box:By default, when a user searches for Post(s) in the WordPress Administration interface, WordPress will search the wp_posts table to find any partial content matches across the following fields: Title Content Excerpt If we try to search for a partial phone number, we’ll see that no results appear:For our Contact Custom Post Type, this isn’t very useful if we want to find a contact by phone number or email address!Advanced Custom Fields stores its data in the wp_postmeta table, which WordPress doesn’t search by default.
Continue Reading:
Create a Simple CRM in WordPress: Extending WordPress Search to Include Custom Fields