[wp-trac] [WordPress Trac] #22744: Media search doesn't include file name

WordPress Trac noreply at wordpress.org
Mon Jul 14 05:36:35 UTC 2014


#22744: Media search doesn't include file name
-----------------------------------------------+---------------------------
 Reporter:  johnbillion                        |       Owner:
     Type:  task (blessed)                     |  wonderboymusic
 Priority:  normal                             |      Status:  reviewing
Component:  Media                              |   Milestone:  4.0
 Severity:  normal                             |     Version:  3.0
 Keywords:  has-patch needs-docs dev-feedback  |  Resolution:
                                               |     Focuses:
                                               |  administration
-----------------------------------------------+---------------------------

Comment (by michalzuber):

 This "visual" output change might help docs
 {{{
   /**
    * $sql = array(
    *     'join' =>  INNER JOIN wp_postmeta ON (wp_posts.ID =
 wp_postmeta.post_id)
    *     'where' => AND ( (CAST(wp_postmeta.meta_value AS CHAR) LIKE
 '%code%') )
    *                AND ( wp_postmeta.meta_key = '_wp_attached_file' )
    * )
    **/
   if ( 0 === strpos( $sql['where'], ' AND (' ) ) {
       list( $_, $clauses ) = explode( ' AND ', $sql['where'], 2 );
       $sql['where'] = " OR ({$clauses})";
   }
   /**
    * $sql = array(
    *     'join' =>  INNER JOIN wp_postmeta ON (wp_posts.ID =
 wp_postmeta.post_id)
    *     'where' => OR (
    *                  ( (CAST(wp_postmeta.meta_value AS CHAR) LIKE
 '%code%') )
    *                  AND ( wp_postmeta.meta_key = '_wp_attached_file' )
    *                )
    * )
    **/
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/22744#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list