Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ( ! function_exists( 'kleo_get_search_menu_item' ) ) {
- function kleo_get_search_menu_item()
- {
- $context = sq_option('search_context', '');
- if (is_array($context)) {
- $context = implode(',', $context);
- }
- //Defaults
- $action = home_url('/');
- $hidden = '';
- $input_name = 's';
- if (function_exists('bp_is_active') && $context == 'members') {
- //Buddypress members form link
- $action = bp_get_members_directory_permalink();
- } elseif (function_exists('bp_is_active') && bp_is_active('groups') && $context == 'groups') {
- //Buddypress group directory link
- $action = bp_get_groups_directory_permalink();
- } elseif (class_exists('bbPress') && $context == 'forum') {
- $action = bbp_get_search_url();
- $input_name = 'bbp_search';
- } elseif ($context == 'product') {
- $hidden .= '<input type="hidden" name="post_type" value="product">';
- }
- ob_start();
- ?>
- <a class="search-trigger" href="#"><i class="icon icon-search"></i></a>
- <div class="kleo-search-wrap searchHidden" id="ajax_search_container">
- <form class="form-inline" id="ajax_searchform" action="<?php echo $action; ?>"
- data-context="<?php echo $context; ?>">
- <?php echo $hidden; ?>
- <input name="<?php echo $input_name; ?>" class="ajax_s form-control" autocomplete="off" type="text"
- value="<?php if (isset($_REQUEST['s'])) {
- echo esc_attr($_REQUEST['s']);
- } ?>" placeholder="<?php _e("Start typing to search...", "kleo_framework"); ?>">
- <span class="kleo-ajax-search-loading"><i class="icon-spin6 animate-spin"></i></span>
- </form>
- <div class="kleo_ajax_results"></div>
- </div>
- <?php
- $form = ob_get_clean();
- return $form;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment