Title: Include file meta
Last modified: June 3, 2019

---

# Include file meta

 *  Resolved [Concept Image](https://wordpress.org/support/users/devci/)
 * (@devci)
 * [7 years ago](https://wordpress.org/support/topic/include-file-meta/)
 * Hi,
 * Is it possible to include file meta in search. Like description (post_content),
   legend (post_excerpt) and alt (postmeta).
 * I think about something like this maybe (description / legend):
 *     ```
       private function getFileConditions($words)
       {
             $words = !$this->config['whole_phrases'] ? explode(' ', $words) : [$words];
             $list  = [];
   
             foreach ($words as $word) {
               $word   = addslashes($word);
               $temp = [];
               $temp[] = 'd.post_title LIKE \'%' . $word . '%\'';
               $temp[] = 'd.post_content LIKE \'%' . $word . '%\'';
   
               $list[] = '(' . implode(') OR (', $temp) . ')';
             }
   
             $list = '(' . implode(') AND (', $list) . ')';
             return $list;
           }
       ```
   
 * Thanks in advance

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Mateusz Gbiorczyk](https://wordpress.org/support/users/mateuszgbiorczyk/)
 * (@mateuszgbiorczyk)
 * [7 years ago](https://wordpress.org/support/topic/include-file-meta/#post-11605827)
 * Hi [@devci](https://wordpress.org/support/users/devci/),
 * Try to use filters for this:
    [https://developer.wordpress.org/reference/hooks/posts_join/](https://developer.wordpress.org/reference/hooks/posts_join/)
   [https://developer.wordpress.org/reference/hooks/posts_search/](https://developer.wordpress.org/reference/hooks/posts_search/)
 * Do you have a problem with this plugin? Then you will be happy to help.,
 * Try to use filters for this:
    [https://developer.wordpress.org/reference/hooks/posts_join/](https://developer.wordpress.org/reference/hooks/posts_join/)
   [https://developer.wordpress.org/reference/hooks/posts_search/](https://developer.wordpress.org/reference/hooks/posts_search/)
 * Do you have a problem with this plugin? Then you will be happy to help.
 *  Thread Starter [Concept Image](https://wordpress.org/support/users/devci/)
 * (@devci)
 * [7 years ago](https://wordpress.org/support/topic/include-file-meta/#post-11607353)
 * Thank you, I’ll try this.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Include file meta’ is closed to new replies.

 * ![](https://ps.w.org/acf-better-search/assets/icon-256x256.png?rev=2636287)
 * [ACF: Better Search](https://wordpress.org/plugins/acf-better-search/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/acf-better-search/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/acf-better-search/)
 * [Active Topics](https://wordpress.org/support/plugin/acf-better-search/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/acf-better-search/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/acf-better-search/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Concept Image](https://wordpress.org/support/users/devci/)
 * Last activity: [7 years ago](https://wordpress.org/support/topic/include-file-meta/#post-11607353)
 * Status: resolved