Advertisement
rdusnr

Untitled

Jun 7th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. if ( ! function_exists( 'kleo_search_menu_item' ) ) {
  2. /**
  3. * Add search to menu
  4. *
  5. * @param string $items
  6. * @param object $args
  7. *
  8. * @return string
  9. */
  10. function kleo_search_menu_item( $items, $args ) {
  11. if ( sq_option( 'ajax_search', 1 ) == 'logged_in' && ! is_user_logged_in() ) {
  12. return $items;
  13. }
  14.  
  15. $location = sq_option( 'menu_search_location', 'primary' );
  16.  
  17. if ( $args->theme_location == $location ) {
  18. $form = echo do_shortcode('[wpdreams_ajaxsearchpro id=1])');
  19. $items .= '<li id="nav-menu-item-search" class="menu-item kleo-search-nav">' . $form . '</li>';
  20. }
  21.  
  22. return $items;
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement