Wednesday, November 16, 2022
HomeWordPress Developmentsearch - How make Autocomplete with wp_query in post_type attachment

search – How make Autocomplete with wp_query in post_type attachment


That is my record of arguments to seek for the hooked up information and I must make it take references, for instance, if my file is named banner, when putting the letter b, stated file and others that will include this identical letter seem with out having to put all the pieces. the identify I can’t discover the answer

    if (isset($_GET['search']) && !empty($_GET['search'])) {
        $worth = $_GET['search'];
    }
    
    if (isset($_GET['select']) && !empty($_GET['select'])) {
        $test = $_GET['select'];
    }

$query_images_args = array(
            's' => $worth,
            'post_type' => 'attachment', 
            'post_status' => 'inherit',
            'orderby' => 'date', 
            'order' => 'DESC',
            'post_mime_type' => $test,
            'posts_per_page' => '-1'
        ); 

        $query_images = new WP_Query(  $query_images_args  );

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments