Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Shortcode: [juice_search_form class="additional-classname"]
- */
- function juice_custom_search_form( $atts = array(), $content = '' ) {
- $atts = shortcode_atts(
- array(
- 'class' => '',
- ),
- $atts,
- 'juice_search_form'
- );
- $extra_class = trim( preg_replace( '/[^A-Za-z0-9_\-\s]/', '', $atts['class'] ) );
- $wrapper_classes = trim(
- sprintf(
- 'jeg_search_wrapper jeg_search_no_expand %s %s',
- get_theme_mod( 'jnews_header_menu_search_form_style', 'round' ),
- $extra_class
- )
- );
- ob_start();
- ?>
- <div class="jeg_nav_item jeg_nav_search">
- <div class="<?php echo esc_attr( $wrapper_classes ); ?>">
- <a href="#" class="jeg_search_toggle" aria-label="<?php esc_attr_e( 'Toggle search', 'jnews' ); ?>">
- <i class="fa fa-search" aria-hidden="true"></i>
- </a>
- <?php
- get_search_form();
- ?>
- </div>
- </div>
- <?php
- return ob_get_clean();
- }
- add_shortcode( 'juice_search_form', 'juice_custom_search_form' );
Advertisement
Add Comment
Please, Sign In to add comment