function usces_nextpage() {
document.getElementById(\'usces_paged\').value = ' . ( $uscpaged + 1 ) . ';
document.searchindetail.submit();
}
function usces_prepage() {
document.getElementById(\'usces_paged\').value = ' . ( $uscpaged - 1 ) . ';
document.searchindetail.submit();
}
function newsubmit() {
document.getElementById(\'usces_paged\').value = 1;
}
';
$html .= '
';
if ( isset( $_REQUEST['usces_search'] ) ) {
$catresult = usces_search_categories();
$search_query = array(
'category__and' => $catresult,
'posts_per_page' => 10,
'paged' => $uscpaged,
);
$search_query = apply_filters( 'usces_filter_search_query', $search_query );
$my_query = new WP_Query( $search_query );
$html .= '
' . esc_html__( 'Search results', 'usces' ) . ' ' . number_format( $my_query->found_posts ) . esc_html__( 'cases', 'usces' ) . '
';
if ( $my_query->have_posts() ) {
$html .= apply_filters( 'usces_filter_search_result_pre', null, $my_query );
$html .= '
';
$itemhtml = '
';
while ( $my_query->have_posts() ) {
$my_query->the_post();
usces_the_item();
$itemhtml .= '
' . $post->post_content . '
';
}
$itemhtml .= '
';
$html .= apply_filters( 'usces_filter_search_result', $itemhtml, $my_query );
$html .= '
';
wp_reset_postdata();
} else {
$html .= '
';
$html .= '
' . esc_html__( 'The article was not found.', 'usces' ) . '
';
$html .= '
';
}
}
$html .= '
';
$html .= '
';