php - Adapting a wordpress search to search multiple fields -
i trying adapt existing search allow searches not staff names titles (job roles).
currently following form method:
<form method="get" action="<?php echo get_post_type_archive_link('staff'); ?>" class="search" data-behavior="search">
and get_post_type_archive_link
function
function get_post_type_archive_link( $post_type ) { global $wp_rewrite; if ( ! $post_type_obj = get_post_type_object( $post_type ) ) return false; if ( ! $post_type_obj->has_archive ) return false; if ( get_option( 'permalink_structure' ) && is_array( $post_type_obj->rewrite ) ) { $struct = ( true === $post_type_obj->has_archive ) ? $post_type_obj->rewrite['slug'] : $post_type_obj->has_archive; if ( $post_type_obj->rewrite['with_front'] ) $struct = $wp_rewrite->front . $struct; else $struct = $wp_rewrite->root . $struct; $link = home_url( user_trailingslashit( $struct, 'post_type_archive' ) ); } else { $link = home_url( '?post_type=' . $post_type ); } return apply_filters( 'post_type_archive_link', $link, $post_type ); }
this function has nothing searching wordpress database. instead, echoing out url tells form submit. need find out happens once form submitted url. there standard wordpress functions , filters searching, i'm guessing based you've shown here there custom functionality in code somewhere executing search somehow using word "staff".
where function? in plugin? theme? there other functions around it? suggest looking around in general area of function has sql queries , paste that function here at.
Comments
Post a Comment