Advertisement
Guest User

Untitled

a guest
Apr 4th, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. if ( ! function_exists( 'jas_helpdesk_search_form' ) ) {
  2. function jas_helpdesk_search_form() {
  3. $output = '';
  4.  
  5. // Search form
  6. $kb_search = cs_get_option( 'kb-search-box' );
  7.  
  8. if ( is_post_type_archive( 'jhelp-kb' ) && $kb_search ) {
  9. $output .= '<form role="search" method="get" class="jas-search-form clearfix" action="' . esc_url( home_url( '/' ) ) . '">';
  10. $output .= '<label>';
  11. $output .= '<input type="text" class="search-field jas-kb-ajax-search"
  12. placeholder="' . esc_attr__( 'Search ...', 'helpdesk' ) . '"
  13. value="' . get_search_query() . '" name="s"
  14. title="' . esc_attr__( 'Search for:', 'helpdesk' ) . '" />';
  15. $output .= '<input type="hidden" value="jhelp-kb" name="post_type" id="post_type" />';
  16. $output .= '</label>';
  17. $output .= '<input type="submit" class="search-submit f__mont fs__16"
  18. value="' . esc_attr__( 'Search', 'helpdesk' ) . '" />';
  19. $output .= '</form>';
  20. } elseif ( is_singular ( 'jhelp-kb' ) ) {
  21. $output .= '<form role="search" method="get" class="jas-search-form clearfix" action="' . esc_url( home_url( '/' ) ) . '">';
  22. $output .= '<label>';
  23. $output .= '<input type="text" class="search-field jas-kb-ajax-search"
  24. placeholder="' . esc_attr__( 'Search ...', 'helpdesk' ) . '"
  25. value="' . get_search_query() . '" name="s"
  26. title="' . esc_attr__( 'Search for:', 'helpdesk' ) . '" />';
  27. $output .= '<input type="hidden" value="jhelp-kb" name="post_type" id="post_type" />';
  28. $output .= '</label>';
  29. $output .= '<input type="submit" class="search-submit f__mont fs__16"
  30. value="' . esc_attr__( 'Search', 'helpdesk' ) . '" />';
  31. $output .= '</form>';
  32. } elseif ( function_exists( 'is_bbpress' ) && is_bbpress() && cs_get_option( 'forum-search-box' ) ) {
  33. $output .= do_shortcode( '[bbp-search-form]' );
  34. }
  35.  
  36. return apply_filters( 'jas_helpdesk_search_form', $output );
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement